Skip to content

Merge pull request #28 from ultra-coins/update-flake-lockfile #85

Merge pull request #28 from ultra-coins/update-flake-lockfile

Merge pull request #28 from ultra-coins/update-flake-lockfile #85

Workflow file for this run

name: deploy
on:
push:
branches: ["main"]
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: blog
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Check Articles
run: nix develop --command bash -c "zola check"
container:
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get Current Time (Tag Name)
id: tag
run: echo "time=$(date +%Y%m%d%H%M%S%9N)" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Container
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
- name: Update timestamp message
run: sed -i '1 s/#timestamp/#timestamp:${{ steps.tag.outputs.time }}/g' release/prod.compose.yaml
- name: Show release/prod.compose.yaml
run: cat release/prod.compose.yaml
- name: Push prod.compose.yaml to release branch
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: release
FOLDER: release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}