Skip to content

Commit b0338c1

Browse files
committed
Adding distinct github image deployable.
1 parent 0eac2c0 commit b0338c1

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

.github/workflows/build_and_deploy.yml

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ on:
44
branches:
55
- staging
66
- main
7+
paths-ignore:
8+
- 'README.md'
9+
- 'docs/**'
10+
- 'scripts/**'
11+
- '.github/ISSUE_TEMPLATE/**'
12+
13+
concurrency:
14+
group: deploy-${{ github.ref_name }}
15+
cancel-in-progress: true
716

817
jobs:
918
build:
@@ -14,21 +23,32 @@ jobs:
1423
with:
1524
username: ${{ secrets.DOCKERHUB_USERNAME }}
1625
password: ${{ secrets.DOCKERHUB_TOKEN }}
17-
- name: Set Docker image tag
18-
run: |
26+
- name: Login to GHCR
27+
uses: docker/login-action@v2
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.actor }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Set image tags
33+
run: |
1934
echo "GITHUB_REF = $GITHUB_REF" > version.py
2035
echo "GITHUB_SHA = $GITHUB_SHA" >> version.py
21-
36+
2237
if [[ $GITHUB_REF == refs/heads/main ]]; then
23-
echo "DOCKER_IMAGE_TAG=latest" >> $GITHUB_ENV
38+
echo "IMAGE_TAGS=eepmoody/open5e-api:latest" >> $GITHUB_ENV
2439
elif [[ $GITHUB_REF == refs/heads/staging ]]; then
25-
echo "DOCKER_IMAGE_TAG=staging" >> $GITHUB_ENV
40+
{
41+
echo "IMAGE_TAGS<<EOF"
42+
echo "eepmoody/open5e-api:staging"
43+
echo "ghcr.io/open5e/open5e-api:beta"
44+
echo "EOF"
45+
} >> $GITHUB_ENV
2646
fi
2747
- name: Build and push
2848
uses: docker/build-push-action@v7
2949
with:
3050
push: true
31-
tags: eepmoody/open5e-api:${{ env.DOCKER_IMAGE_TAG }}
51+
tags: ${{ env.IMAGE_TAGS }}
3252

3353
deploy:
3454
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)