mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
name: Publish container image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types:
|
|
- created
|
|
schedule:
|
|
- cron: '00 00 * * *'
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f211e3e9ded2d9377c8cadc4489a4e38014bc4c9 # v1.7.0
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1.14.1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Set tag for image
|
|
run: |
|
|
echo IMAGE_TAG=$([ ${{ github.ref_type }} == 'tag' ] && echo ${{ github.ref_name }} || echo 'latest') >> $GITHUB_ENV
|
|
- name: Build and Push release
|
|
if: github.event_name != 'schedule'
|
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2.10.0
|
|
with:
|
|
context: .
|
|
build-args: |
|
|
INSTALL_ALL=true
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
|
|
ghcr.io/${{ github.repository }}:latest
|
|
- name: Build and Push nightly
|
|
if: github.event_name == 'schedule'
|
|
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a # v2.10.0
|
|
with:
|
|
context: .
|
|
build-args: |
|
|
INSTALL_ALL=true
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: |
|
|
ghcr.io/${{ github.repository }}:nightly
|