Move website builds to GitLab CI

Repo cloning will go by next week.

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@gmail.com>
This commit is contained in:
Andrei Jiroh Halili 2023-07-13 18:13:07 +00:00
parent 4ae868cf37
commit 9e61cf7e65
6 changed files with 88 additions and 222 deletions

View file

@ -9,21 +9,16 @@ on:
schedule:
- cron: '30 22 * * *'
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build-devenv:
build-ci:
name: Build development environment
runs-on: ubuntu-latest
permissions:
@ -47,39 +42,52 @@ jobs:
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
uses: docker/setup-buildx-action@v2
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
- name: Log into GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ secrets.HUB_USERNAME }}
password: ${{ secrets.HUB_TOKEN }}
- name: Log into RHQCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.RHQCR_BOT_USERNAME }}
password: ${{ secrets.RHQCR_BOT_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: |
ghcr.io/${{ env.IMAGE_NAME }}/build-ci
quay.io/ajhalili2006/mkdocs-material-build-ci
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,enable=true,priority=100,prefix=commit-,suffix=,format=short
type=schedule,pattern=nightly
- uses: actions/checkout@v3
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: .gitpod.Dockerfile
dockerfile: docker/Dockerfile
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
uses: docker/build-push-action@v4.1.1
with:
context: .
file: .gitpod.Dockerfile
context: docker
file: Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}