Skip to content

Commit

Permalink
Merge pull request #90 from cloud-barista/seokho-son-patch-3
Browse files Browse the repository at this point in the history
Update publish-multi-arch-container-images.yaml
  • Loading branch information
seokho-son authored Oct 30, 2023
2 parents 3f4d347 + e9d07fc commit 4a0574a
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/publish-multi-arch-container-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
# The "push" event could replace "merged" event.
push:
branches:
- master
- main
tags:
- "v*.*.*"
paths-ignore:
Expand All @@ -21,20 +21,25 @@ on:
- 'LICENSE'
- 'CODEOWNERS'
- 'assets/**'
- 'test/**'
- 'scripts/**'
- 'src/testclient/scripts/**'
- 'docs/**'

jobs:
# The job key is "publishing"
publishing:
# Job name is "Publishing"
name: Publishing

# This job runs on Ubuntu-latest
runs-on: ubuntu-18.04
if: github.repository == 'cloud-barista/cb-mapui'

# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest

steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
uses: actions/checkout@v4

- name: Prepare tags
id: prep
Expand All @@ -55,50 +60,50 @@ jobs:
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.*$ ]]; then
DOCKER_TAGS="$DOCKER_TAGS,${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=docker-tags::${DOCKER_TAGS}
echo "docker-tags=${DOCKER_TAGS}" >> $GITHUB_OUTPUT
echo ${DOCKER_TAGS}
GHCR_IMAGE=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
GHCR_TAGS="${GHCR_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.*$ ]]; then
GHCR_TAGS="$GHCR_TAGS,${GHCR_IMAGE}:latest"
fi
echo ::set-output name=ghcr-tags::${GHCR_TAGS}
echo "ghcr-tags=${GHCR_TAGS}" >> $GITHUB_OUTPUT
echo ${GHCR_TAGS}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Hub
uses: docker/login-action@v1.10.0
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# TODO: Create a PAT with `read:packages` and `write:packages` scopes and save it as an Actions secret `CR_PAT`
- name: Login to GitHub Container Registry
uses: docker/login-action@v1.10.0
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}

- name: Build and publish
id: docker_build
uses: docker/build-push-action@v2.7.0
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
Expand Down

0 comments on commit 4a0574a

Please sign in to comment.