Skip to content

Merge pull request #65 from puppetlabs/maint_one #223

Merge pull request #65 from puppetlabs/maint_one

Merge pull request #65 from puppetlabs/maint_one #223

Workflow file for this run

name: image-push
on:
push:
branches:
- main
- stable
tags:
- '[0-9]+.*'
jobs:
main:
runs-on: ubuntu-latest
steps:
-
name: Set tag to nightly
if: endsWith(github.ref, '/main')
run: echo "TAG=nightly" >> $GITHUB_ENV
-
name: Set tag to stable or latest
if: endsWith(github.ref, '/stable')
run: echo "TAG=latest" >> $GITHUB_ENV
-
name: Set tag to git tag name
if: startsWith(github.ref, 'refs/tags/')
run: echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to ECR
id: login_ecr
uses: docker/login-action@v2
with:
registry: ${{ secrets.AWS_FORGE_ID }}.dkr.ecr.us-west-2.amazonaws.com
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
-
name: Build and push PDK
id: docker_build_pdk
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
${{ secrets.AWS_FORGE_ID }}.dkr.ecr.us-west-2.amazonaws.com/anubis:${{ env.TAG }}
puppet/pdk:${{ env.TAG }}
-
name: Image digest
run: |
echo 'PDK: ${{ steps.docker_build_pdk.outputs.digest }}'