Merge pull request #23 from Evanlab02/release-please--branches--trunk #39
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
on: | |
push: | |
branches: | |
- trunk | |
permissions: write-all | |
name: Release | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
api_release_created: ${{ steps.release.outputs.backend--release_created }} | |
api_tag_name: ${{ steps.release.outputs.backend--tag_name }} | |
docs_release_created: ${{ steps.release.outputs.docs--release_created }} | |
docs_tag_name: ${{ steps.release.outputs.docs--tag_name }} | |
frontend_release_created: ${{ steps.release.outputs.frontend--release_created }} | |
frontend_tag_name: ${{ steps.release.outputs.frontend--tag_name }} | |
site_release_created: ${{ steps.release.outputs.site--release_created }} | |
site_tag_name: ${{ steps.release.outputs.site--tag_name }} | |
components_release_created: ${{ steps.release.outputs['packages/components--release_created'] }} | |
steps: | |
- uses: googleapis/release-please-action@v4 | |
id: release | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
config-file: release-please-config.json | |
manifest-file: .release-please-manifest.json | |
components-release: | |
runs-on: ubuntu-latest | |
needs: [release-please] | |
defaults: | |
run: | |
working-directory: packages/components | |
if: ${{ needs.release-please.outputs.components_release_created }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install Dependencies | |
run: | | |
npm ci | |
- name: Build Package | |
run: | | |
npm run build | |
- name: Publish Package | |
run: | | |
echo //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} >> ~/.npmrc | |
npm publish --access public | |
full-release: | |
runs-on: ubuntu-latest | |
needs: [release-please] | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.16.0' | |
cache: 'npm' | |
cache-dependency-path: ./frontend/package-lock.json | |
- name: Setup Github Packages Token | |
working-directory: ./frontend | |
run: echo //npm.pkg.github.com/:_authToken=${{ secrets.PKG_KEY }} >> ~/.npmrc | |
- name: Install Dependencies | |
working-directory: ./frontend | |
run: npm ci | |
- name: Build Frontend | |
working-directory: ./frontend | |
run: npm run build | |
- name: Build Latest Images | |
run: | | |
docker build -f ./docker/admin/Dockerfile -t hp-admin:latest . | |
docker build -f ./docker/backend/Dockerfile -t hp-api:latest . | |
docker build -f ./docker/site/Dockerfile -t hp-site:latest . | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Upload Tagged Images to Registry | |
run: | | |
docker tag hp-admin:latest ghcr.io/evanlab02/hp-admin:${{ needs.release-please.outputs.tag_name }} | |
docker push ghcr.io/evanlab02/hp-admin:${{ needs.release-please.outputs.tag_name }} | |
docker tag hp-api:latest ghcr.io/evanlab02/hp-api:${{ needs.release-please.outputs.tag_name }} | |
docker push ghcr.io/evanlab02/hp-api:${{ needs.release-please.outputs.tag_name }} | |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.tag_name }} | |
docker push ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.tag_name }} | |
- name: Upload Latest Images to Registry | |
run: | | |
docker tag hp-admin:latest ghcr.io/evanlab02/hp-admin:latest | |
docker push ghcr.io/evanlab02/hp-admin:latest | |
docker tag hp-api:latest ghcr.io/evanlab02/hp-api:latest | |
docker push ghcr.io/evanlab02/hp-api:latest | |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:latest | |
docker push ghcr.io/evanlab02/hp-site:latest | |
installer-release: | |
runs-on: ubuntu-latest | |
needs: [release-please] | |
if: ${{ needs.release-please.outputs.release_created }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create installation directory | |
run: | | |
mkdir -p ./HomePortal | |
cp ./compose.yaml ./HomePortal | |
mkdir -p ./HomePortal/site | |
cp ./site/examples/Caddyfile ./HomePortal/site/Caddyfile | |
cp -r ./scripts ./HomePortal | |
cp ./.env.template ./HomePortal | |
- name: Create installer zip | |
run: | | |
zip -r HomePortal.zip ./HomePortal | |
- name: Upload installer zip | |
run: | | |
gh release upload ${{ needs.release-please.outputs.tag_name }} HomePortal.zip | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} |