feat: fixes ci
This commit is contained in:
45
.github/workflows/docker-publish.yml
vendored
45
.github/workflows/docker-publish.yml
vendored
@@ -2,8 +2,6 @@ name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -11,7 +9,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
node-version: [22.12.0]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
@@ -27,35 +25,28 @@ jobs:
|
||||
docker:
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
|
||||
env:
|
||||
IMAGE_TAG: ${{ github.ref_name == 'main' && 'latest' || 'dev' }}
|
||||
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/frontend-hideyoshi.com:latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write # required to push to ghcr.io
|
||||
id-token: write # optional for OIDC if you use it
|
||||
|
||||
steps:
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: yoshiunfriendly/frontend-hideyoshi.com:latest
|
||||
- name: Build image
|
||||
run: docker build -t $IMAGE_NAME .
|
||||
|
||||
run-dispatcher:
|
||||
needs: docker
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- name: Runs Infra-Hideyoshi.com Deployment Dispatcher
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/HideyoshiSolutions/infra-hideyoshi.com/dispatches \
|
||||
-H 'Accept: application/vnd.github.everest-preview+json' \
|
||||
-u ${{ secrets.ACTIONS_KEY }} \
|
||||
--data '{"event_type": "refresh-deployments", "client_payload": { "deployments": "frontend-deployment" }}'
|
||||
- name: Push image
|
||||
run: docker push $IMAGE_NAME
|
||||
|
||||
Reference in New Issue
Block a user