ci: change ghcr.io/coder/coder-preview:main tag to use version names (#8938)

This commit is contained in:
Muhammad Atif Ali
2023-08-07 16:41:20 +03:00
committed by GitHub
parent e7047726d8
commit 90c1647fcf
+2 -6
View File
@@ -701,7 +701,6 @@ jobs:
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -741,12 +740,9 @@ jobs:
--push \
build/coder_linux_amd64
# Get commit sha to be used as package tag
new_package_tag=$(gh api repos/coder/coder/commits/main | jq -r '.sha[0:7]')
# Tag image with new package tag and push
docker tag ghcr.io/coder/coder-preview:main ghcr.io/coder/coder-preview:main-$new_package_tag
docker push ghcr.io/coder/coder-preview:main-$new_package_tag
docker tag ghcr.io/coder/coder-preview:main ghcr.io/coder/coder-preview:main-$version
docker push ghcr.io/coder/coder-preview:main-$version
- name: Prune old images
uses: vlaurin/action-ghcr-prune@v0.5.0