Merge pull request #2 from nesi/add-xvfb-to-base #11
Workflow file for this run
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: Create and publish Docker images using Packer | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
REPO_OWNER: ${{ github.repository_owner }} | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Setup packer | |
uses: hashicorp/setup-packer@main | |
- run: ansible --version | |
- name: Initialise packer for base image | |
run: | |
packer init -upgrade base-template.pkr.hcl | |
working-directory: packer | |
- name: Build and push base image | |
run: | | |
export PKR_VAR_docker_repository="${REGISTRY}/${REPO_OWNER}/nesi-docker-base" | |
packer build base-template.pkr.hcl | |
working-directory: packer | |
env: | |
PKR_VAR_docker_tag: ${{ github.ref_name }} | |
PKR_VAR_docker_username: ${{ github.actor }} | |
PKR_VAR_docker_password: ${{ secrets.GITHUB_TOKEN }} | |
PKR_VAR_docker_server: ${{ env.REGISTRY }} | |
- name: Initialise packer for vnc image | |
run: | |
packer init -upgrade vnc-template.pkr.hcl | |
working-directory: packer | |
- name: Build and push vnc image | |
run: | | |
export PKR_VAR_docker_repository="${REGISTRY}/${REPO_OWNER}/nesi-ondemand-vnc" | |
export PKR_VAR_docker_repository_base="${REGISTRY}/${REPO_OWNER}/nesi-docker-base" | |
packer build vnc-template.pkr.hcl | |
working-directory: packer | |
env: | |
PKR_VAR_docker_tag: ${{ github.ref_name }} | |
PKR_VAR_docker_username: ${{ github.actor }} | |
PKR_VAR_docker_password: ${{ secrets.GITHUB_TOKEN }} | |
PKR_VAR_docker_server: ${{ env.REGISTRY }} |