diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de1e8346f..5d9432e47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,62 +3,59 @@ name: ci on: push: branches: - - '**' + - '*' tags: - 'v*' pull_request: - branches: - - 'master' - + permissions: packages: write contents: read - + jobs: - docker: - environment: Docker Hub + build: runs-on: ubuntu-latest + steps: - - + - + name: Checkout repository + uses: actions/checkout@v3 + + - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v4 with: images: | ghcr.io/${{ github.repository_owner }}/cross-seed - ${{ secrets.DOCKERHUB_USERNAME }}/cross-seed tags: | type=semver,pattern=version-{{version}} - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} type=ref,event=branch type=ref,event=pr - - + + - name: Set up QEMU dependency uses: docker/setup-qemu-action@v1 - - + + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v1 - - + + - name: Login to GHCR uses: docker/login-action@v1 with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v2 + password: ${{ secrets.GHCR_PASSWORD }} + + - + name: Build and push Docker image + uses: docker/build-push-action@v4 with: push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + \ No newline at end of file