chill_hugoplate/.gitea/workflows/build-image.yaml

74 lines
1.8 KiB
YAML
Raw Normal View History

2024-01-24 09:46:27 +00:00
name: Build an image to deploy website
on:
# Runs on pushes targeting the default branch
push:
2024-01-24 13:21:06 +00:00
tags:
- v*
2024-01-24 09:46:27 +00:00
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Environment variables available to all jobs and steps in this workflow
env:
HUGO_ENV: production
HUGO_VERSION: "0.121.2"
2024-01-24 09:54:04 +00:00
GO_VERSION: "1.21.4"
2024-01-24 09:46:27 +00:00
NODE_VERSION: "18"
jobs:
# Build job
build:
2024-01-24 12:09:22 +00:00
runs-on: cth-ubuntu-latest
2024-01-24 09:46:27 +00:00
steps:
- name: Check out repository
uses: https://github.com/actions/checkout@v4
- name: Setup node
uses: https://github.com/actions/setup-node@v4
with:
node-version: '${{ NODE_VERSION }}'
- name: Setup Hugo
2024-01-24 09:49:16 +00:00
uses: https://github.com/peaceiris/actions-hugo@v2
2024-01-24 09:46:27 +00:00
with:
hugo-version: '${{ HUGO_VERSION }}'
2024-01-24 09:59:11 +00:00
extended: true
2024-01-24 09:46:27 +00:00
2024-01-24 09:53:22 +00:00
- name: Setup Go
2024-01-24 09:54:51 +00:00
uses: https://github.com/actions/setup-go@v5
2024-01-24 09:53:22 +00:00
with:
2024-01-24 09:56:16 +00:00
go-version: '1.21.4'
2024-01-24 09:53:22 +00:00
2024-01-24 09:46:27 +00:00
- name: Setup Project
run: npm run project-setup
- name: Install npm dependencies
run: npm install
- name: Compile website
run: npm run build
2024-01-24 10:10:34 +00:00
- name: Set up Docker Buildx
uses: https://github.com/docker/setup-buildx-action@v3
- name: Login to registry
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: 'h3m6q87t.gra7.container-registry.ovh.net'
2024-01-24 12:21:54 +00:00
- name: debug
run: ls -lah
2024-01-24 10:10:34 +00:00
- name: Build and push
uses: https://github.com/docker/build-push-action@v5
with:
2024-01-24 12:29:18 +00:00
context: .
2024-01-24 10:10:34 +00:00
push: true
2024-01-24 13:21:06 +00:00
tags: 'h3m6q87t.gra7.container-registry.ovh.net/chill_website/web:${{ github.ref_name }}'