-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 1.94 KB
/
production-dockerize.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI-Production-Dockerize
on:
push:
branches:
- production
run-name: Dockerize of production version. Triggerd by ${{github.actor}}
jobs:
dockerize:
name: Dockerize and upload
runs-on: ubuntu-latest
steps:
# Checkout repository code
- name: Repository Checkout
uses: actions/checkout@v4
# Set Node.js version environment
- name: Node.js version 18 Environment setting
uses: actions/setup-node@v4
with:
node-version: 18
# Install dependencies
- name: Install Dependencies
run: npm install --force
- name: Check Build Status
run: npm run build
- name: Setup QEMU for multiplatform build
uses: docker/setup-qemu-action@v3
- name: Setup docker buildx and set platform
uses: docker/setup-buildx-action@v3
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- id: build-n-push
name: Build and Push
uses: docker/build-push-action@v5
continue-on-error: true
with:
context: .
push: true
tags: hoplindev/online-judge:latest
platforms: linux/amd64,linux/arm64
- name: 'Discord Alert - Success'
if: steps.build-n-push.outcome == 'success'
uses: rjstone/discord-webhook-notify@v1
with:
severity: info
details: 'Docker Deploy Success - Architecture: linux/amd64, linux/arm64'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: 'Discord Alert - Fail'
if: steps.build-n-push.outcome != 'success'
uses: rjstone/discord-webhook-notify@v1
with:
severity: error
details: 'Docker Deploy Failed'
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
- name: 'Fail check'
if: steps.build-n-push.outcome != 'success'
run: exit1