Skip to content

Commit

Permalink
ci: tag release container images
Browse files Browse the repository at this point in the history
  • Loading branch information
avivace authored Sep 21, 2024
1 parent 6b72067 commit a870f7d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Update Docker image

on:
push:
branches:
- master
tags:
- '*' # This triggers the action on all tag pushes

jobs:
publish-docker-image:
Expand All @@ -13,13 +16,22 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image to the GHCR

- name: Build and push the master container image
run: |
docker build . --tag ghcr.io/gbdev/rgbds:master
docker push ghcr.io/gbdev/rgbds:master
- name: Tag release container image
if: startsWith(github.ref, 'refs/tags/')
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
docker tag ghcr.io/gbdev/rgbds:master ghcr.io/gbdev/rgbds:$TAG_NAME
docker push ghcr.io/gbdev/rgbds:$TAG_NAME

0 comments on commit a870f7d

Please sign in to comment.