-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow used to build the karmada-dashboard image
Signed-off-by: dev <cossjie@foxmail.com> Update karmada-dashboard.yaml Signed-off-by: dev <cossjie@foxmail.com> Add GitHub workflow used to build the karmada-dashboard image Signed-off-by: dev <cossjie@foxmail.com>
- Loading branch information
1 parent
a52f0d3
commit 69d5a2f
Showing
2 changed files
with
41 additions
and
2 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,39 @@ | ||
name: Image-Build-And-Push | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build-and-push: | ||
# prevent job running from forked repository, otherwise | ||
# 1. running on the forked repository would fail as missing necessary secret. | ||
# 2. running on the forked repository would use unnecessary GitHub Action time. | ||
if: ${{ github.repository == 'karmada-io/dashboard' && github.ref == 'refs/heads/main' }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.18.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Build | ||
run: | | ||
echo "start build" | ||
npm install | ||
npm run build | ||
docker build . --file Dockerfile --tag ${{ secrets.IMAGE_REPOSITORY }}/${{ secrets.IMAGE_NAME }}:${{ secrets.IMAGE_VERSION }} | ||
- name: Login in to Docker Hub | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ secrets.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Push image | ||
run: | | ||
echo "push image" | ||
docker push ${{ secrets.IMAGE_REPOSITORY }}/${{ secrets.IMAGE_NAME }}:${{ secrets.IMAGE_VERSION }} |
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