-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (37 loc) · 1.28 KB
/
docker-image.yaml
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
35
36
37
38
39
40
41
42
43
name: Build and Push Docker Image
on:
release:
types: [created]
push:
branches:
- development
- staging
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- name: Lowercase repository
id: repository
uses: ASzc/change-string-case-action@ccb130a4e483d3e86287289183704dc9bf53e77e
with:
string: ${{ github.repository }}
- name: Get tag version
id: get_version
run: echo "::set-output name=VERSION::${GITHUB_REF#refs/tags/v}"
- name: Log in to GitHub Container Registry
uses: docker/login-action@1f36f5b7a2d2f7bfd524795fc966e6d88c37baa9
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
push: true
tags: ghcr.io/${{ steps.repository.outputs.lowercase }}:${{ steps.get_version.outputs.VERSION }}
build-args: |
NODE_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}