From 27e8a792fdf216853c7f6c1933b75cbd6b0702b3 Mon Sep 17 00:00:00 2001 From: Sergey Stepanov Date: Wed, 26 May 2021 22:23:47 +0300 Subject: [PATCH] Publish Docker images from the stable/unstable code. v-tagged push -> v-tagged stable image with stable tag also master push -> dev tagged image --- ..._publish.yml => docker_publish_stable.yml} | 15 +++++------ .github/workflows/docker_publish_unstable.yml | 26 +++++++++++++++++++ .github/workflows/redeploy.sh | 1 - scripts/redeploy.sh | 0 4 files changed, 33 insertions(+), 9 deletions(-) rename .github/workflows/{docker_publish.yml => docker_publish_stable.yml} (69%) create mode 100644 .github/workflows/docker_publish_unstable.yml delete mode 100644 .github/workflows/redeploy.sh mode change 100644 => 100755 scripts/redeploy.sh diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish_stable.yml similarity index 69% rename from .github/workflows/docker_publish.yml rename to .github/workflows/docker_publish_stable.yml index 8f012096..a88a27e5 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish_stable.yml @@ -1,32 +1,31 @@ # ------------------------------------------------------------------------ -# Publish Docker image from the current snapshot into Github repository +# Publish Docker image from the stable snapshot into Github repository # ------------------------------------------------------------------------ -name: publish +name: publish-stable on: push: - branches: - - master tags: - 'v*' jobs: - docker-publish: + docker-publish-stable: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + - uses: docker/build-push-action@v1 with: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} add_git_labels: true - tag_with_ref: true - tags: latest + tags: latest,${{ env.TAG }} registry: docker.pkg.github.com repository: ${{ github.REPOSITORY }}/cloud-game - name: Redeploy - run: ./scripts/redeploy.sh \ No newline at end of file + run: ./scripts/redeploy.sh diff --git a/.github/workflows/docker_publish_unstable.yml b/.github/workflows/docker_publish_unstable.yml new file mode 100644 index 00000000..8f8abe1e --- /dev/null +++ b/.github/workflows/docker_publish_unstable.yml @@ -0,0 +1,26 @@ +# ---------------------------------------------------------------------------- +# 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@v2 + + - uses: docker/build-push-action@v1 + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + add_git_labels: true + tags: dev + + registry: docker.pkg.github.com + repository: ${{ github.REPOSITORY }}/cloud-game diff --git a/.github/workflows/redeploy.sh b/.github/workflows/redeploy.sh deleted file mode 100644 index 38327722..00000000 --- a/.github/workflows/redeploy.sh +++ /dev/null @@ -1 +0,0 @@ -echo "test" diff --git a/scripts/redeploy.sh b/scripts/redeploy.sh old mode 100644 new mode 100755