diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index eac6211a..659c2527 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -12,18 +12,23 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Login to registry - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL - env: - DOCKER_REGISTRY_URL: docker.pkg.github.com - DOCKER_USERNAME: ${{ github.actor }} - DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 - - name: Build docker image - run: | - docker build . -f alpine.Dockerfile --pull --no-cache -t docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:lts-alpine + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 - - name: Push docker image - run: | - docker push docker.pkg.github.com/napi-rs/napi-rs/nodejs-rust:lts-alpine + - name: Login to GitHub Packages Docker Registry + uses: docker/login-action@v1 + with: + registry: docker.pkg.github.com + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v2 + with: + file: alpine.Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: docker.pkg.github.com/${{ github.repository }}/nodejs-rust:lts-alpine