diff --git a/.github/workflows/publish-multi-arch-container-images.yaml b/.github/workflows/publish-multi-arch-container-images.yaml index 5d48a7e..7957f61 100644 --- a/.github/workflows/publish-multi-arch-container-images.yaml +++ b/.github/workflows/publish-multi-arch-container-images.yaml @@ -11,7 +11,7 @@ on: # The "push" event could replace "merged" event. push: branches: - - master + - main tags: - "v*.*.*" paths-ignore: @@ -21,7 +21,9 @@ on: - 'LICENSE' - 'CODEOWNERS' - 'assets/**' - - 'test/**' + - 'scripts/**' + - 'src/testclient/scripts/**' + - 'docs/**' jobs: # The job key is "publishing" @@ -29,12 +31,15 @@ jobs: # 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 @@ -55,27 +60,27 @@ 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 }} @@ -83,14 +88,14 @@ jobs: ${{ 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 }} @@ -98,7 +103,7 @@ jobs: - 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: ./