docs: correct typos and inconsistencies in README #31
This file contains hidden or 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: Build and Push Container Images | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - '[0-9]+-*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| IMAGE_GHCR: ghcr.io/${{ github.repository_owner }}/astroneer-server | |
| IMAGE_DOCKERIO: docker.io/${{ vars.DOCKERHUB_USERNAME }}/astroneer-server | |
| jobs: | |
| build-and-push: | |
| runs-on: ${{ matrix.runner }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-24.04 | |
| platform: linux/amd64 | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| platform: linux/arm64 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Determine image tag | |
| id: tag | |
| run: | | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| if [ "$BRANCH_NAME" = "main" ]; then | |
| TAG="latest" | |
| elif [ "$BRANCH_NAME" = "dev" ]; then | |
| TAG="experimental" | |
| elif [[ "$BRANCH_NAME" =~ ^([0-9]+)- ]]; then | |
| TAG="issue-${BASH_REMATCH[1]}" | |
| else | |
| TAG="unknown" | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Log in to docker.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| platforms: ${{ matrix.platform }} | |
| push: true | |
| provenance: false | |
| tags: | | |
| ${{ env.IMAGE_GHCR }}:${{ matrix.arch }}-${{ steps.tag.outputs.tag }} | |
| ${{ env.IMAGE_DOCKERIO }}:${{ matrix.arch }}-${{ steps.tag.outputs.tag }} | |
| manifest: | |
| needs: build-and-push | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Determine image tag | |
| id: tag | |
| run: | | |
| BRANCH_NAME="${{ github.ref_name }}" | |
| if [ "$BRANCH_NAME" = "main" ]; then | |
| TAG="latest" | |
| elif [ "$BRANCH_NAME" = "dev" ]; then | |
| TAG="experimental" | |
| elif [[ "$BRANCH_NAME" =~ ^([0-9]+)- ]]; then | |
| TAG="issue-${BASH_REMATCH[1]}" | |
| else | |
| TAG="unknown" | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Log in to docker.io | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: docker.io | |
| username: ${{ vars.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Create and push manifest | |
| run: | | |
| TAG="${{ steps.tag.outputs.tag }}" | |
| docker manifest create $IMAGE_GHCR:$TAG \ | |
| --amend $IMAGE_GHCR:amd64-$TAG \ | |
| --amend $IMAGE_GHCR:arm64-$TAG | |
| docker manifest push $IMAGE_GHCR:$TAG | |
| docker manifest create $IMAGE_DOCKERIO:$TAG \ | |
| --amend $IMAGE_DOCKERIO:amd64-$TAG \ | |
| --amend $IMAGE_DOCKERIO:arm64-$TAG | |
| docker manifest push $IMAGE_DOCKERIO:$TAG |