mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
ci: tag release container images
This commit is contained in:
14
.github/workflows/build-container.yml
vendored
14
.github/workflows/build-container.yml
vendored
@@ -1,8 +1,11 @@
|
|||||||
name: Update Docker image
|
name: Update Docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
tags:
|
||||||
|
- '*' # This triggers the action on all tag pushes
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-docker-image:
|
publish-docker-image:
|
||||||
@@ -13,13 +16,22 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Build and push Docker image to the GHCR
|
|
||||||
|
- name: Build and push the master container image
|
||||||
run: |
|
run: |
|
||||||
docker build . --tag ghcr.io/gbdev/rgbds:master
|
docker build . --tag ghcr.io/gbdev/rgbds:master
|
||||||
docker push 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
|
||||||
|
|||||||
Reference in New Issue
Block a user