Add attest for release image #2
Workflow file for this run
This file contains 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
name: Docker | |
on: | |
push: | |
# Publish semver tags as releases. | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
IMAGE_NAME: bubylou/steamcmd | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Docker buildx | |
uses: docker/[email protected] | |
# Login against a Github registry except on PR | |
- name: Log into github container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# Login for Docker registry | |
- name: Log into docker container registry | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
registry: docker.io | |
username: ${{ vars.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
# Build and push Docker image with Bake (don't push on PR) | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
push: ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }} | |
env: | |
TAG: ${{ github.ref_name }} |