Building and Publication triggered by pvshvp-oss #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |