diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml new file mode 100644 index 0000000..2efbe4a --- /dev/null +++ b/.github/workflows/package.yaml @@ -0,0 +1,39 @@ +name: package + +on: + push: + branches: + - main + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + package: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v6 + with: + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + tags: ghcr.io/${{ github.repository }}/nginx:${{ env.TAG }} + env: + TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}