Merge pull request #1965 from OctopusDeploy/sf/fonts-and-preloading #141
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: Deploy | |
on: | |
# Disable on push temporarily while we're doing the migration | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab on GitHub. | |
# Allow this job to clone the repo and create a page deployment | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
OCTOPUS_URL: ${{ secrets.OCTOPUSSERVERURL }} | |
OCTOPUS_API_KEY: ${{ secrets.OCTOPUSSERVERAPIKEY }} | |
OCTOPUS_SPACE: "DevOps Microsite" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: NPM and Playwright install | |
run: | | |
echo; echo "cd to workspace" | |
cd $GITHUB_WORKSPACE | |
echo; echo "listing" | |
ls | |
echo; echo "NPM install" | |
npm ci | |
npx playwright install --with-deps | |
- name: Astro build and test | |
run: | | |
export NODE_OPTIONS=--max_old_space_size=4096 | |
npm run test | |
- name: Set Version | |
run: | | |
echo "PACKAGE_VERSION=$(date +'%Y.%m.%d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV | |
- name: Check output | |
run: | | |
echo; echo "cd to workspace" | |
cd $GITHUB_WORKSPACE | |
echo; echo "listing" | |
ls | |
- name: Create a Zip package π | |
id: package | |
uses: OctopusDeploy/create-zip-package-action@v3 | |
with: | |
package_id: 'DocsMicrosite' | |
version: "${{ env.PACKAGE_VERSION }}" | |
base_path: "./dist" | |
output_folder: "./artifacts" | |
files: | | |
**/*.* | |
- name: Push a package to Octopus Deploy π | |
uses: OctopusDeploy/[email protected] | |
with: | |
packages: ${{ steps.package.outputs.package_file_path }} | |
- name: Push build information to Octopus Deploy π | |
uses: OctopusDeploy/push-build-information-action@v3 | |
with: | |
version: "${{ env.PACKAGE_VERSION }}" | |
packages: "Docs Microsite" | |
- name: Create a release in Octopus Deploy π | |
uses: OctopusDeploy/create-release-action@v3 | |
id: "create_release" | |
with: | |
project: "Docs Microsite" | |
package_version: "${{ env.PACKAGE_VERSION }}" | |
git_ref: ${{ github.ref }} | |
- name: Deploy the release in Octopus Deploy π | |
uses: OctopusDeploy/deploy-release-action@v3 | |
id: "queue_deployments" | |
with: | |
project: "Docs Microsite" | |
release_number: ${{ steps.create_release.outputs.release_number }} | |
environments: | | |
Test |