generated from pixx/chirpy-starter
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: "Build and Deploy"
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
paths-ignore:
|
|
- .gitignore
|
|
- README.md
|
|
- LICENSE
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
# Allow one concurrent deployment
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
# submodules: true
|
|
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
|
|
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build \
|
|
-t git.pixx.cz/${{ gitea.repository }}:${{ gitea.sha }} \
|
|
-t git.pixx.cz/${{ gitea.repository }}:latest .
|
|
|
|
- name: Login to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${CI_REGISTRY:-git.pixx.cz} \
|
|
-u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin
|
|
|
|
- name: Push Docker image
|
|
run: |
|
|
docker push ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:${{ gitea.sha }}
|
|
docker push ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:latest
|
|
|