diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60765c7..2a6e558 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,24 +2,33 @@ name: Build on Release on: release: - types: [published] + types: [created] jobs: build: runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + steps: - - uses: actions/checkout@v3 - - - name: Log in to GHCR - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ghcr.io/marcus7i/ulinkshortener:latest + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: ghcr.io/marcus7i/ulinkshortener:latest \ No newline at end of file