Skip to content

Added env

Added env #3

name: Publish Full
permissions:
contents: write
on:
# also run on push to master
push:
branches:
- main
workflow_dispatch:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup bun 🔧
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install
- name: Install pkg
run: bun install -g pkg
# Bump the version (patch/minor/major)
- name: Bump version
run: bun run bump
# Stage and commit any uncommitted changes (if necessary)
- name: Stage and commit uncommitted changes
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
# Push the version bump to the master branch using the PAT
- name: Push version bump
env:
GIT_COMMITTER_NAME: GitHub Action
GIT_COMMITTER_EMAIL: [email protected]
run: |
git commit -am "bumping version" && git push "https://${{ secrets.PAT_TOKEN }}@github.com/${{ github.repository }}" HEAD:master --follow-tags
- name: Decode PEM file
run: echo "${{ secrets.CERTIFICATE_PEM_BASE64 }}" | base64 --decode > ./akv_test_cert.pem
- name: Build
run: bun run build
- name: Read current version from package.json
id: read_version
run: echo "PACKAGE_VERSION=$(jq -r .version < package.json)" >> $GITHUB_ENV
# Package into zip using Octopus zip package action
- name: Create a Zip package 🐙
uses: OctopusDeploy/create-zip-package-action@v3
with:
package_id: 'deadlock_backend'
version: ${{ env.PACKAGE_VERSION }}
output_folder: './artifacts'
base_path: './dist'
files: 'deadlock_backend'
# Push zip package to Octopus
- name: Push package to Octopus 🐙
uses: OctopusDeploy/push-package-action@v3
with:
api_key: ${{ secrets.OCTOPUS_SERVER_API_KEY }}
server: ${{ secrets.OCTOPUS_SERVER_URL }}
packages: "./artifacts/deadlock_backend.${{ env.PACKAGE_VERSION }}.zip"
space: ${{ secrets.OCTOPUS_SERVER_SPACE }}
# simplies echos the github.ref var
- name: Echo github.ref
run: echo ${{ github.ref }}
# Create and deploy release using Octopus Deploy action
- name: Deploy a release in Octopus Deploy 🐙
uses: OctopusDeploy/create-release-action@v3
env:
OCTOPUS_API_KEY: ${{ secrets.OCTOPUS_SERVER_API_KEY }}
OCTOPUS_URL: ${{ secrets.OCTOPUS_SERVER_URL }}
OCTOPUS_SPACE: ${{ secrets.OCTOPUS_SERVER_SPACE }}
with:
project: "deadlock-backend"
package_version: ${{ env.PACKAGE_VERSION }}
environments: |
Staging