-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update node version and create release action
- Loading branch information
Showing
3 changed files
with
80 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Build and push Docker image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/bus-map:latest | ||
ghcr.io/${{ github.repository_owner }}/bus-map:${{ github.event.release.tag_name }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,61 @@ | ||
name: Build and push Docker image | ||
name: Bump Version and Create Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
type: | ||
required: true | ||
default: 'patch' | ||
description: 'Bump type' | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
|
||
jobs: | ||
build-and-push: | ||
bump-version: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/[email protected] | ||
- uses: pnpm/action-setup@v4 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
node-version: 23.x | ||
cache: pnpm | ||
|
||
- name: Bump version | ||
id: bump_version | ||
run: | | ||
pnpm version ${{ github.event.inputs.type }} -m "ci: bump version to %s" | ||
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV" | ||
- name: Push changes | ||
run: | | ||
git push origin main --follow-tags | ||
- name: Create a Release | ||
uses: elgohr/Github-Release-Action@v5 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
context: . | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/bus-map:latest | ||
ghcr.io/${{ github.repository_owner }}/bus-map:${{ github.event.release.tag_name }} | ||
title: Release ${{ env.VERSION }} | ||
tag: ${{ env.VERSION }} | ||
# - name: Create Release | ||
# uses: actions/create-release@v1 | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# with: | ||
# tag_name: v${{ env.VERSION }} | ||
# release_name: Release v${{ env.VERSION }} | ||
# body: 'Automated release based on version bump to v${{ env.VERSION }}.' | ||
# draft: false | ||
# prerelease: false |
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