refactor: oci #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push WordPress Docker Images | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Nix | |
uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push PHP 8.1 image | |
run: | | |
nix build .#wordpress-php81 | |
docker load < result | |
docker tag wordpress-php81:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php81 | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php81 | |
- name: Build and push PHP 8.2 image | |
run: | | |
nix build .#wordpress-php82 | |
docker load < result | |
docker tag wordpress-php82:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php82 | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php82 | |
docker tag wordpress-php82:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
- name: Build and push PHP 8.3 image | |
run: | | |
nix build .#wordpress-php83 | |
docker load < result | |
docker tag wordpress-php83:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php83 | |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:php83 |