Skip to content

automate build of packer-resource in github actions + publish in ghcr #1

automate build of packer-resource in github actions + publish in ghcr

automate build of packer-resource in github actions + publish in ghcr #1

name: Publish Actions Runner Image
on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/packer-resource
jobs:
build-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU #emulation support with QEMU to be able to build against more platforms.
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push the container to GitHub Container Registry using the latest tag
uses: docker/[email protected]
with:
context: .
file: Dockerfile
platforms: |
linux/amd64
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
push: true
provenance: false