Skip to content

deps(deps): bump docker/login-action from 2.2.0 to 3.3.0 (#13) #28

deps(deps): bump docker/login-action from 2.2.0 to 3.3.0 (#13)

deps(deps): bump docker/login-action from 2.2.0 to 3.3.0 (#13) #28

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish Alwatr Containers
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
branches:
- next
- main
pull_request:
paths:
- '.github/workflows/publish-container.yml'
- 'Dockerfile'
env:
REGISTRY: ghcr.io
USERNAME: ${{github.repository_owner}}
jobs:
build:
if: github.repository_owner == 'njfamirm'
name: Build Container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: ⤵️ Checkout repository
uses: actions/[email protected]
- name: 🏗 Setup Docker Buildx
uses: docker/[email protected]
- name: 🏗 Log into registry ${{ env.REGISTRY }}
if: ${{ github.event_name != 'pull_request' }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🏗 Extract metadata
id: meta
uses: docker/[email protected]
if: ${{ github.event_name != 'pull_request' }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
images: name=${{ env.REGISTRY }}/${{ env.USERNAME }}/decap-cms-github-backend,enable=true
labels: |
[email protected]
org.opencontainers.image.title=@alwatr/decap-cms-github-backend
org.opencontainers.image.description='Self-hosted decap cms github backend'
tags: |
type=semver,enable=true,pattern={{major}}
type=semver,enable=true,pattern={{major}}.{{minor}}
type=semver,enable=true,pattern={{version}}
type=ref,enable=true,event=pr
type=ref,enable=true,event=branch
- name: 🚀 Build and push container image
id: build-and-push
uses: docker/[email protected]
with:
push: ${{ github.event_name != 'pull_request' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
context: .
file: Dockerfile
# build-args: |
cache-from: type=gha
cache-to: type=gha,mode=max
# - name: 🏗 Install cosign
# if: ${{ github.event_name != 'pull_request' }}
# uses: sigstore/[email protected]
# - name: 🏗 Sign the published container image
# if: ${{github.event_name != 'pull_request'}}
# env:
# COSIGN_EXPERIMENTAL: 'true'
# run: echo "${{steps.meta.outputs.tags}}" | xargs -I {} cosign sign --yes {}@${{steps.build-and-push.outputs.digest}}