- Using docker setup via actions #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docker publish | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-amd64: | |
runs-on: ubuntu-latest | |
timeout-minutes: 360 | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: setup qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: setup buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: print available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: set version from tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: print version number | |
run: echo ${{ env.RELEASE_VERSION }} | |
- name: login to dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} | |
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} | |
- name: build & upload | |
run: | | |
docker buildx build \ | |
--push \ | |
--tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 \ | |
--platform linux/amd64 \ | |
--file Dockerfile . | |
build-arm64: | |
runs-on: macos-13 | |
timeout-minutes: 360 | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: setup docker on macOS | |
uses: douglascamata/setup-docker-macos-action@v1-alpha | |
- name: setup qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: setup buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: print available platforms | |
run: echo ${{ steps.buildx.outputs.platforms }} | |
- name: set version from tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: print version number | |
run: echo ${{ env.RELEASE_VERSION }} | |
- name: login to dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} | |
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} | |
- name: build & upload | |
run: | | |
docker buildx build \ | |
--push \ | |
--tag plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 \ | |
--platform linux/arm64 \ | |
--file Dockerfile . | |
build-manifest: | |
runs-on: ubuntu-latest | |
timeout-minutes: 360 | |
needs: [build-amd64, build-arm64] | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: set version from tag | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: print version number | |
run: echo ${{ env.RELEASE_VERSION }} | |
- name: login to dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_UPLOAD_USERNAME }} | |
password: ${{ secrets.DOCKER_UPLOAD_TOKEN }} | |
- name: create manifest | |
run: docker manifest create plattar/python-usd:version-${{ env.RELEASE_VERSION }} plattar/python-usd:version-${{ env.RELEASE_VERSION }}-amd64 plattar/python-usd:version-${{ env.RELEASE_VERSION }}-arm64 | |
- name: upload manifest | |
run: docker manifest push plattar/python-usd:version-${{ env.RELEASE_VERSION }} |