Skip to content

chore(deps): update node.js to e2852e6 (#437) #437

chore(deps): update node.js to e2852e6 (#437)

chore(deps): update node.js to e2852e6 (#437) #437

---
name: build-and-release
on:
push:
branches:
- main
env:
IMAGE_NAME_PREFIX: ${{ github.repository_owner }}/api
IMAGE_NAME_GHCR_PREFIX: ghcr.io/${{ github.repository_owner }}/api
KUSTOMIZE_VERSION: v5.1.0
jobs:
build:
name: Build
runs-on: ubuntu-24.04
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
pull: true
push: true
tags: |
${{env.IMAGE_NAME_GHCR_PREFIX}}:latest
${{env.IMAGE_NAME_GHCR_PREFIX}}:${{ github.sha }}
cache-from: type=registry,ref=${{env.IMAGE_NAME_GHCR_PREFIX}}:latest
cache-to: type=inline
deploy:
name: Deploy
runs-on: ubuntu-24.04
needs: build
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- name: Set up Kustomize
working-directory: k8s/staging
run: |-
curl -O -L https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/${{env.KUSTOMIZE_VERSION}}/kustomize_${{env.KUSTOMIZE_VERSION}}_linux_amd64.tar.gz
tar xzf ./kustomize_${{env.KUSTOMIZE_VERSION}}_linux_amd64.tar.gz
chmod u+x ./kustomize
- name: Update image name
working-directory: k8s/staging
run: |-
./kustomize edit set image IMAGE_NAME=${{env.IMAGE_NAME_GHCR_PREFIX}}:${{ github.sha }}
- uses: EndBug/add-and-commit@v9
with:
add: 'k8s/staging/kustomization.yaml'
message: New version release for api ${{ github.sha }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}