Skip to content

Commit

Permalink
chore: Some release please fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanlab02 committed Oct 15, 2024
1 parent 7237327 commit 9c2b351
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 8 deletions.
146 changes: 146 additions & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,152 @@ jobs:
echo //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} >> ~/.npmrc
npm publish --access public
backend-release:
runs-on: ubuntu-latest
needs: [release-please]
if: ${{ needs.release-please.outputs.api_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 Image
run: |
docker build -f ./docker/admin/Dockerfile -t hp-admin:latest .
docker build -f ./docker/backend/Dockerfile -t hp-api:latest .
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Upload Tagged Image to Registry
run: |
docker tag hp-admin:latest ghcr.io/evanlab02/hp-admin:${{ needs.release-please.outputs.api_tag_name }}
docker push ghcr.io/evanlab02/hp-admin:${{ needs.release-please.outputs.api_tag_name }}
docker tag hp-api:latest ghcr.io/evanlab02/hp-api:${{ needs.release-please.outputs.api_tag_name }}
docker push ghcr.io/evanlab02/hp-api:${{ needs.release-please.outputs.api_tag_name }}
- name: Upload Latest Image to Registry
if: ${{ !needs.release-please.outputs.release_created }}
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
docs-release:
runs-on: ubuntu-latest
needs: [release-please]
if: ${{ needs.release-please.outputs.docs_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 Image
run: |
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 Image to Registry
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.docs_tag_name }}
docker push ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.docs_tag_name }}
- name: Upload Latest Image to Registry
if: ${{ !needs.release-please.outputs.release_created && !needs.release-please.outputs.frontend_release_created && !needs.release-please.outputs.site_release_created }}
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:latest
docker push ghcr.io/evanlab02/hp-site:latest
frontend-release:
runs-on: ubuntu-latest
needs: [release-please]
if: ${{ needs.release-please.outputs.frontend_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 Image
run: |
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 Image to Registry
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.frontend_tag_name }}
docker push ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.frontend_tag_name }}
- name: Upload Latest Image to Registry
if: ${{ !needs.release-please.outputs.release_created && !needs.release-please.outputs.site_release_created }}
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:latest
docker push ghcr.io/evanlab02/hp-site:latest
site-release:
runs-on: ubuntu-latest
needs: [release-please]
if: ${{ needs.release-please.outputs.site_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 Image
run: |
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 Image to Registry
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.site_tag_name }}
docker push ghcr.io/evanlab02/hp-site:${{ needs.release-please.outputs.site_tag_name }}
- name: Upload Latest Image to Registry
if: ${{ !needs.release-please.outputs.release_created }}
run: |
docker tag hp-site:latest ghcr.io/evanlab02/hp-site:latest
docker push ghcr.io/evanlab02/hp-site:latest
full-release:
runs-on: ubuntu-latest
needs: [release-please]
Expand Down
4 changes: 4 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
".": "0.3.0",
"backend": "0.3.0",
"docs": "0.3.0",
"frontend": "0.3.0",
"site": "0.2.0",
"packages/components": "0.1.0"
}
9 changes: 1 addition & 8 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@
"separate-pull-requests": true,
"release-type": "node"
},
"site": {
"release-type": "simple",
"package-name": "home-portal-site"
},
".": {
"include-component-in-tag": false,
"release-type": "simple",
"exclude-paths": [
"packages/components",
"frontend",
"backend",
"docs"
"packages/components"
]
}
},
Expand Down

0 comments on commit 9c2b351

Please sign in to comment.