diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..ca76920 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,50 @@ +on: + push: + branches: + - main + tags: + - v* + +name: deploy + +permissions: + packages: write + +jobs: + deploy: + runs-on: ubuntu-latest + env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + steps: + - uses: actions/checkout@v3 + - name: Log in to the container registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.PAT }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=edge,branch=main + type=sha + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + - name: Build container + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 791c2cb..537f7a6 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -2,15 +2,12 @@ on: push: branches: - main - tags: - - "v*" name: release-please permissions: contents: write pull-requests: write - packages: write jobs: release-please: @@ -21,40 +18,3 @@ jobs: release-type: elixir package-name: shroud.email bootstrap-sha: b182fc93f050cab66c45bcd08a4701785881e822 - - deploy: - needs: release-please - runs-on: ubuntu-latest - env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - steps: - - uses: actions/checkout@v3 - - name: Log in to the container registry - uses: docker/login-action@v2 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{major}} - type=raw,value=main - type=sha - - name: Setup Docker buildx - uses: docker/setup-buildx-action@v2 - - name: Build container - uses: docker/build-push-action@v4 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max