mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Update Docker GH Action
Now it will push the master tag instead of dev for the main branch.
This commit is contained in:
parent
df980c5cf4
commit
31638b0805
4 changed files with 49 additions and 61 deletions
2
.github/workflows/cd/docker-compose.yml
vendored
2
.github/workflows/cd/docker-compose.yml
vendored
|
|
@ -2,7 +2,7 @@ version: "3.9"
|
|||
|
||||
x-params:
|
||||
&default-params
|
||||
image: ghcr.io/giongto35/cloud-game/cloud-game:${IMAGE_TAG:-dev}
|
||||
image: ghcr.io/giongto35/cloud-game/cloud-game:${IMAGE_TAG:-master}
|
||||
network_mode: "host"
|
||||
privileged: true
|
||||
restart: always
|
||||
|
|
|
|||
48
.github/workflows/docker_publish.yml
vendored
Normal file
48
.github/workflows/docker_publish.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# ----------------------------------------------------------------------------------
|
||||
# Publish Docker image from the current master branch or v* into Github repository
|
||||
# ----------------------------------------------------------------------------------
|
||||
|
||||
name: docker-publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
docker-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: echo "V=$(./scripts/version.sh)" >> $GITHUB_ENV
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}/cloud-game
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
- uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/build-push-action@v4
|
||||
with:
|
||||
build_args: VERSION=${{ env.V }}
|
||||
context: .
|
||||
push: true
|
||||
provenance: false
|
||||
sbom: false
|
||||
tags: |
|
||||
${{ steps.meta.outputs.tags }}
|
||||
labels: |
|
||||
${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
31
.github/workflows/docker_publish_stable.yml
vendored
31
.github/workflows/docker_publish_stable.yml
vendored
|
|
@ -1,31 +0,0 @@
|
|||
# ------------------------------------------------------------------------
|
||||
# Publish Docker image from the stable snapshot into Github repository
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
name: publish-stable
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
docker-publish-stable:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||
|
||||
- run: echo "V=$(./scripts/version.sh)" >> $GITHUB_ENV
|
||||
|
||||
- uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
add_git_labels: true
|
||||
tags: latest,${{ env.TAG }}
|
||||
build_args: VERSION=${{ env.V }}
|
||||
|
||||
registry: docker.pkg.github.com
|
||||
repository: ${{ github.REPOSITORY }}/cloud-game
|
||||
29
.github/workflows/docker_publish_unstable.yml
vendored
29
.github/workflows/docker_publish_unstable.yml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
# ----------------------------------------------------------------------------
|
||||
# Publish Docker image from the current master branch into Github repository
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
name: publish-unstable
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
docker-publish-unstable:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: echo "V=$(./scripts/version.sh)" >> $GITHUB_ENV
|
||||
|
||||
- uses: docker/build-push-action@v1
|
||||
with:
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
add_git_labels: true
|
||||
tags: dev
|
||||
build_args: VERSION=${{ env.V }}
|
||||
|
||||
registry: docker.pkg.github.com
|
||||
repository: ${{ github.REPOSITORY }}/cloud-game
|
||||
Loading…
Add table
Add a link
Reference in a new issue