Skip to content

start gh actions workflows #118

start gh actions workflows

start gh actions workflows #118

Workflow file for this run

name: WG-Easy Image CI
on:
push:
branches: [ main ]
paths:
- 'applications/wg-easy/**'
- '.github/workflows/wg-easy-image.yml'
pull_request:
paths:
- 'applications/wg-easy/**'
- '.github/workflows/wg-easy-image.yml'
workflow_dispatch:
env:
DEV_CONTAINER_REGISTRY: ghcr.io
DEV_CONTAINER_IMAGE: replicatedhq/platform-examples/wg-easy-tools
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.DEV_CONTAINER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DEV_CONTAINER_REGISTRY }}/${{ env.DEV_CONTAINER_IMAGE }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=short
type=ref,event=branch
type=ref,event=pr
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: applications/wg-easy
file: applications/wg-easy/container/Containerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max