Skip to content

Create image on push #44

Create image on push

Create image on push #44

Workflow file for this run

name: CI
on:
pull_request:
branches: ["master"]
workflow_call:
env:
IMAGE_NAME: site-server
IMAGE_TAGS: latest ${{ github.sha }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
jobs:
build:
strategy:
matrix:
java-version: ["20"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Prepare java
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: ${{ matrix.java-version }}
- name: Setup Clojure
uses: DeLaGuardo/[email protected]
with:
cli: 1.10.3.1040
- name: Checkout
uses: actions/checkout@v2-beta
- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-
- name: Run tests not Windows
if: ${{ matrix.os != 'windows-latest' }}
run: make
working-directory: server
shell: bash
- name: Run tests on Windows
if: ${{ matrix.os == 'windows-latest' }}
run: make
working-directory: server
shell: powershell
# Build image using Buildah action
- name: Build Image
uses: redhat-actions/buildah-build@v2
id: build_image
with:
containerfiles: ./Dockerfile
image: ${{ env.IMAGE_NAME }}
oci: true
# Push the image to GHCR (Image Registry)
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust