Use repo-scoped image for internal build image (#821)

* Use repo-scoped image for internal build image

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
This commit is contained in:
Anuraag Agrawal
2022-10-04 14:05:50 +09:00
committed by GitHub
parent 0b4dbfd8d6
commit 25d9901568

View File

@@ -8,11 +8,11 @@ on:
- cron: "23 3 * * *" - cron: "23 3 * * *"
workflow_dispatch: # Allows manual refresh workflow_dispatch: # Allows manual refresh
# This builds images and pushes them to ghcr.io/tetratelabs/wazero-internal:$tag # This builds images and pushes them to ghcr.io/tetratelabs/wazero/internal-$tag
# Using these avoid docker.io rate-limits particularly on pull requests. # Using these avoid docker.io rate-limits particularly on pull requests.
jobs: jobs:
copy-images: copy-images:
runs-on: ubuntu-20.04 # Hard-coding an LTS means maintenance, but only once each 2 years! runs-on: ubuntu-22.04 # Hard-coding an LTS means maintenance, but only once each 2 years!
strategy: strategy:
matrix: matrix:
# Be precise in tag versions to improve reproducibility # Be precise in tag versions to improve reproducibility
@@ -23,19 +23,18 @@ jobs:
steps: steps:
# Same as doing this locally: echo "${GHCR_TOKEN}" | docker login ghcr.io -u "${GHCR_TOKEN}" --password-stdin # Same as doing this locally: echo "${GHCR_TOKEN}" | docker login ghcr.io -u "${GHCR_TOKEN}" --password-stdin
- name: "Login into GitHub Container Registry" - name: "Login into GitHub Container Registry"
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
# GHCR_TOKEN=<hex token value> # GITHUB_TOKEN=<hex token value>
# - pushes Docker images to ghcr.io # - pushes Docker images to ghcr.io
# - create via https://github.com/settings/tokens # - create via https://github.com/settings/tokens
# - assign via https://github.com/organizations/tetratelabs/settings/secrets/actions
# - needs repo:status, public_repo, write:packages, delete:packages # - needs repo:status, public_repo, write:packages, delete:packages
password: ${{ secrets.GHCR_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull and push - name: Pull and push
run: | # This will only push a single architecture, which is fine as we currently only support amd64 run: | # This will only push a single architecture, which is fine as we currently only support amd64
docker pull ${{ matrix.source }} docker pull ${{ matrix.source }}
docker tag ${{ matrix.source }} ghcr.io/tetratelabs/wazero-internal:${{ matrix.target_tag }} docker tag ${{ matrix.source }} ghcr.io/${{ github.repository }}/internal-${{ matrix.target_tag }}
docker push ghcr.io/tetratelabs/wazero-internal:${{ matrix.target_tag }} docker push ghcr.io/${{ github.repository }}/internal-${{ matrix.target_tag }}