-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (28 loc) · 879 Bytes
/
docker-image.yml
File metadata and controls
34 lines (28 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Docker Image CI
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Login to GitLab Container Registry
uses: docker/login-action@v1
with:
registry: registry.gitlab.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push the Docker image
uses: docker/build-push-action@v2
with:
tags: registry.gitlab.com/${{ secrets.DOCKER_REPO }}:${{ steps.get_version.outputs.VERSION }}
pull: true
push: true
build-args: |
GITHUB_PKG_TOKEN=${{ secrets.PKG_GITHUB_TOKEN }}