-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change trigger use main change trigger try ff again ff state Update endpointconfig.example.json
- Loading branch information
1 parent
f991f54
commit 0a76a8d
Showing
3 changed files
with
107 additions
and
9 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,41 @@ | ||
name: Build and publish image | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
test_build_and_push_to_docker_registry: | ||
name: Test, build and publish image to docker hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
# - uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: '20.x' | ||
# - name: Install dependencies | ||
# run: npm install && npm run postinstall | ||
# - name: Unit tests | ||
# run: npm run test | ||
- name: Docker login | ||
env: | ||
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_ACCESS_TOKEN}} | ||
run: | | ||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||
- name: Determine Docker Image Name | ||
id: image | ||
run: | | ||
if [[ "${{github.ref_name}}" == "master" ]]; then | ||
echo "name=xinfinorg/xdc-zero:latest" >> $GITHUB_OUTPUT | ||
else | ||
echo "name=xinfinorg/xdc-zero:${{github.ref_name}}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Docker build and tag image | ||
run: docker build . --file Dockerfile --tag ${{ steps.image.outputs.name }} | ||
- name: Docker push | ||
run: docker push ${{ steps.image.outputs.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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Build custom branch | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
if: | | ||
( startsWith(github.head_ref, 'feature') || | ||
startsWith(github.head_ref, 'fix') ) | ||
name: Deploy on PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: check out trigger branch | ||
run: | | ||
git fetch origin $BRANCH | ||
git checkout $BRANCH | ||
env: | ||
BRANCH: ${{ github.head_ref }} | ||
|
||
- name: Record branch env | ||
id: branch | ||
run: | | ||
echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT | ||
echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_OUTPUT | ||
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
# echo $repo | ||
# echo $branch | ||
# echo $commit | ||
- name: Docker login | ||
env: | ||
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||
DOCKER_PASSWORD: ${{secrets.DOCKER_ACCESS_TOKEN}} | ||
run: | | ||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin | ||
- name: Determine Docker Image Name | ||
id: image | ||
run: | | ||
echo "name=xinfinorg/xdc-zero:${{ steps.branch.outputs.branch }}" >> $GITHUB_OUTPUT | ||
- name: Build and push image | ||
run: | | ||
docker build . --file docker/Dockerfile --tag ${{ steps.image.outputs.name }} | ||
docker push ${{ steps.image.outputs.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