Skip to content

Commit

Permalink
update workflow, update dockerfiles, add tag latest for build
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Werfling committed May 1, 2023
1 parent 17b1818 commit de02e07
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/docker-image-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,57 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1


- name: Gen tags for flyingfish
id: gen_tags_flyingfish
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish:latest","${{ secrets.DOCKER_USERNAME }}/flyingfish:'${GITHUB_REF/refs\/tags\//}'"]'
else
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish:latest"]'
fi
echo '::set-output name=tags::'$TAGS
- name: Build and push FlyingFish
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile.nginxsrc
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/flyingfish:${{github.ref_name }}

tags: ${{ fromJson(steps.gen_tags_flyingfish.outputs.tags) }}

- name: Gen tags for flyingfish ssh
id: gen_tags_flyingfish_ssh
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish_ssh:latest","${{ secrets.DOCKER_USERNAME }}/flyingfish_ssh:'${GITHUB_REF/refs\/tags\//}'"]'
else
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish_ssh:latest"]'
fi
echo '::set-output name=tags::'$TAGS
- name: Build and push FlyingFish SSH
uses: docker/build-push-action@v2
with:
context: ./
file: ./sshserver/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/flyingfish_ssh:${{github.ref_name }}
tags: ${{ fromJson(steps.gen_tags_flyingfish_ssh.outputs.tags) }}

- name: Gen tags for flyingfish himhip
id: gen_tags_flyingfish_himhip
run: |
if [[ $GITHUB_REF == 'refs/tags/'* ]]; then
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish_himip:latest","${{ secrets.DOCKER_USERNAME }}/flyingfish_himip:'${GITHUB_REF/refs\/tags\//}'"]'
else
TAGS='["${{ secrets.DOCKER_USERNAME }}/flyingfish_himip:latest"]'
fi
echo '::set-output name=tags::'$TAGS
- name: Build and push FlyingFish Himhip
uses: docker/build-push-action@v2
with:
context: ./
file: ./himhip/Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/flyingfish_himip:${{github.ref_name }}
tags: ${{ fromJson(steps.gen_tags_flyingfish_himhip.outputs.tags) }}
7 changes: 7 additions & 0 deletions himhip/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ WORKDIR /opt/core

COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install HimHip --------------------------------------------------------------------------------------------------

WORKDIR /opt/app
Expand Down
7 changes: 7 additions & 0 deletions sshserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ WORKDIR /opt/core

COPY ./core/ ./

RUN rm -R node_modules | true
RUN rm -R dist | true
RUN rm package-lock.json | true

RUN npm install
RUN npm run build

# Copy/Install sshserver -----------------------------------------------------------------------------------------------

WORKDIR /opt/app
Expand Down

0 comments on commit de02e07

Please sign in to comment.