-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (60 loc) · 1.81 KB
/
build_and_publish.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
60
61
62
63
name: Build and Publish
run-name: Building and Publication triggered by ${{ github.actor }}
on:
workflow_dispatch:
workflow_call:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: 🏗 Build
runs-on: ubuntu-latest
steps:
- name: 🎟 Checkout Git Repository
id: checkout_repository_step
uses: actions/checkout@v4
- name: 🔨 Build Project
id: build_project_step
uses: shalzz/[email protected]
env:
BUILD_ONLY: true
- name: ⬆ Upload Artifact
id: upload_artifact_step
uses: actions/upload-artifact@v3
with:
name: Website
path: dist
if-no-files-found: error
release:
needs: build
name: 🎉 Publish
runs-on: ubuntu-latest
steps:
- name: ⬇ Download Artifact
id: download_artiface_step
uses: actions/download-artifact@v3
with:
name: Website
path: dist
- name: ✔️ Verify Artifact
id: verify_artifact_step
run: |
echo "Contents of the dist directory after downloading the artifact: "
ls -l dist
- name: ➡️ Push to the Website Repository
id: push_website_step
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: 'dist'
destination-github-username: 'pax-hub'
destination-repository-name: 'pax-hub.github.io'
user-name: 'pvshvp-oss'
user-email: [email protected]
target-branch: main
create-target-branch-if-needed: true