-
-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (31 loc) · 1.37 KB
/
main.yml
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
name: 'Build and Push Docker Image'
on:
push:
branches: [ master, beta ]
workflow_dispatch:
env:
REGISTRY: 'ghcr.io/va-net'
IMAGE_NAME: 'flare'
jobs:
production_build:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v2
- name: Build container image
run: docker build -t $(echo $REGISTRY)/$(echo $IMAGE_NAME):latest -f ./Dockerfile .
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push production image to GitHub Container Registry
run: docker push $(echo $REGISTRY)/$(echo $IMAGE_NAME):latest
prerelease_build:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/beta' }}
steps:
- uses: actions/checkout@v2
- name: Build container image
run: docker build -t $(echo $REGISTRY)/$(echo $IMAGE_NAME):edge -f ./Dockerfile .
- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push beta image to GitHub Container Registry
run: docker push $(echo $REGISTRY)/$(echo $IMAGE_NAME):edge