-
Notifications
You must be signed in to change notification settings - Fork 9
59 lines (48 loc) · 1.41 KB
/
container-images.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: container-images
on:
push:
branches:
- main
- dev
workflow_dispatch: {}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ori-community/wotw-seedgen
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout 🛎
uses: actions/checkout@master
- name: Wait for other workflow runs to finish
uses: softprops/turnstyle@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}{% raw %}
- name: Set image Tag
run: |
echo IMAGE_TAG=dev >> $GITHUB_ENV
if [ $GITHUB_REF = "refs/heads/main" ]; then
echo IMAGE_TAG=latest >> $GITHUB_ENV
fi
- name: Build and push Docker images
uses: docker/[email protected]
with:
context: .
push: true
file: Dockerfile
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
labels: ${{ steps.meta.outputs.labels }}