I don't even know what to say anymore #4
Workflow file for this run
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
| # GitHub authenticates as you when using ${{ secrets.GITHUB_TOKEN }}. | |
| # Improve this workflow security with a GitHub PAT. Make one with the "Note" as GHCR_GMAIL_CLEANER_PAT here: | |
| # https://github.com/settings/tokens | |
| # then check the following permissions: | |
| # repo | |
| # ... | |
| # workflow | |
| # write:packages | |
| # ... | |
| # Click generate, <copy to clipboard> | |
| # You just created a PAT | |
| # visit your repo, Settings -> Secrets & Variables -> Actions -> Repo Secrets -> New | |
| # Name: GHCR_GMAIL_CLEANER_PAT; Secret: <paste from clipboard> | |
| name: Build and Publish Docker images | |
| # If you want to push images on every git push to the repo:main branch | |
| # on: | |
| # push: | |
| # branches: main | |
| ## If you want to push images only on a new tag/release | |
| on: | |
| release: | |
| types: [created] | |
| env: | |
| REGISTRY: ghcr.io | |
| # IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| # define the job to build and publish docker images | |
| build-and-push-docker-images: | |
| runs-on: ubuntu-latest | |
| # steps to perform in the job | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v6 | |
| # set up Docker build action | |
| # https://github.com/docker/setup-buildx-action | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # https://github.com/docker/metadata-action | |
| - name: Docker metadata | |
| id: meta_main | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.actor }}/gmail-cleaner | |
| # https://github.com/docker/login-action#github-container-registry | |
| - name: Log in to Github Packages | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GHCR_GMAIL_CLEANER_PAT }} | |
| # https://github.com/docker/build-push-action | |
| - name: Build and push image to GitHub Container Registry | |
| id: docker_build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: "./Dockerfile" | |
| platforms: | | |
| linux/amd64 | |
| # Note: tags have to be all lower-case | |
| tags: ${{ steps.meta_main.outputs.tags }} | |
| labels: ${{ steps.meta_main.outputs.labels }} | |
| push: true | |
| - name: Python Image digest | |
| run: echo ${{ steps.docker_build.outputs.digest }} | |