Skip to content

Bump to v0.6.4

Bump to v0.6.4 #16

Workflow file for this run

name: CD Workflow
on:
push:
tags:
- '*'
permissions:
contents: read
packages: write
id-token: write
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/bake-action@v5
env:
TAG: ${{ github.ref_name }}
with:
files: docker-bake.hcl
push: true
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Set up kubectl
uses: azure/setup-kubectl@v4
- name: Set up ID token
uses: actions/github-script@v7
id: id-token
with:
result-encoding: string
script: |
return await core.getIDToken('k8s.chitoku.jp');
- name: Set context
run: |
kubectl config set-cluster k8s.chitoku.jp --server=https://k8s.chitoku.jp
kubectl config set-credentials github-actions --token=${{ steps.id-token.outputs.result }}
kubectl config set-context k8s.chitoku.jp --cluster=k8s.chitoku.jp --user=github-actions
kubectl config use-context k8s.chitoku.jp
- name: Update images
run: |
kubectl set image deployment/hoarder-api \
migration=ghcr.io/chitoku-k/hoarder/api:${{ github.ref_name }}
api=ghcr.io/chitoku-k/hoarder/api:${{ github.ref_name }}
kubectl set image deployment/hoarder-ui \
ui=ghcr.io/chitoku-k/hoarder/ui:${{ github.ref_name }}