Created
February 12, 2022 16:37
-
-
Save kawzar/137ced6dd90b4fcd0d6eaea339af0345 to your computer and use it in GitHub Desktop.
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 project | |
on: | |
workflow_dispatch: | |
jobs: | |
buildForWebGL: | |
name: Build for WebGL | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: Library | |
key: Library-WebGL | |
restore-keys: Library- | |
- name: Start Build | |
uses: game-ci/unity-builder@v2 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
with: | |
targetPlatform: WebGL | |
versioning: Semantic | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-${{ steps.date.outputs.date }}-${{ github.run_id }} | |
path: build/WebGL | |
uploadToFTP: | |
name: Upload to FTP | |
runs-on: ubuntu-latest | |
needs: buildForWebGL | |
steps: | |
- name: Extract branch name | |
shell: bash | |
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | |
id: extract_branch | |
- name: Download build artifact | |
uses: actions/download-artifact@v1 | |
with: | |
name: build | |
path: build/WebGL | |
- name: Upload via FTP | |
uses: isthatcentered/dist-to-ftp@master | |
with: | |
host: ${{ secrets.FTP_SERVER }} | |
user: ${{ secrets.FTP_USER }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
path: build/WebGL | |
into: ${{steps.extract_branch.outputs.branch}}\Release |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment