Merge branch 'main' of https://github.com/fedora-riscv/fedorav-force-… #28
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 Release Fedora-V-Force Images Page | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Build project | |
run: npm run build | |
- name: Archive build output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifact | |
path: build | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifact | |
path: build | |
# - name: Zip build files | |
# run: zip -r build.zip build | |
# | |
# - name: Create GitHub Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ env.TIMESTAMP }} | |
# release_name: Release ${{ env.TIMESTAMP }} | |
# draft: false | |
# prerelease: false | |
# | |
# - name: Upload build to release | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: build.zip | |
# asset_name: build.zip | |
# asset_content_type: application/zip | |
- name: Publish build to remote host | |
run: | | |
mkdir -m 0700 ~/.ssh | |
echo "${{ secrets.PRIVATE_KEY }}" > ~/.ssh/id_rsa | |
chmod 0400 ~/.ssh/id_rsa | |
ssh-keyscan -p ${{ secrets.SERVER_PORT }} ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts | |
rsync -av --delete build/ -e "${{ secrets.SERVER_ENV }}" ${{ secrets.SERVER_PATH }} |