Skip to content

Commit

Permalink
docker update
Browse files Browse the repository at this point in the history
  • Loading branch information
i3rotlher committed Oct 30, 2023
1 parent ff59ea9 commit 2e2221b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 75 deletions.
85 changes: 12 additions & 73 deletions .github/workflows/Build_and_Publish_Images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
jobs:
build-and-publish-release:
runs-on: ubuntu-latest
if: startsWith(github.event.release.name, 'Seed-Test_v')
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -41,7 +40,10 @@ jobs:
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-backend:${{ steps.get_tag_name.outputs.version }}
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-backend:latest
- name: Push Docker Image to Docker Hub as latest
if: ${{ startsWith(github.event.release.name, 'Seed-Test_v') }}
run: docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-backend:latest

# FRONTEND
- name: Build Docker Image
Expand All @@ -55,7 +57,10 @@ jobs:
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-frontend:${{ steps.get_tag_name.outputs.version }}
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-frontend:latest
- name: Push Docker Image to Docker Hub as latest
if: ${{ startsWith(github.event.release.name, 'Seed-Test_v') }}
run: docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-frontend:latest

# SINGLE QUICK DEMO CONTAINER
- name: Build Docker Image as Latest
Expand All @@ -70,7 +75,10 @@ jobs:
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-demo:${{ steps.get_tag_name.outputs.version }}
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-demo:latest
- name: Push Docker Image to Docker Hub as latest
if: ${{ startsWith(github.event.release.name, 'Seed-Test_v') }}
run: docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-demo:latest

- name: Post susccess message
uses: ./actions/notifyTeams
Expand All @@ -88,72 +96,3 @@ jobs:
text: "Publishing Images for release ${{ github.event.release.name }} failed."
style: "failure"
webhook: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}

build-and-publish-test:
runs-on: ubuntu-latest
if: startsWith(github.event.release.name, 'Test_v')
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Install Dependencies
run: npm install node-fetch

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Get Tag Name
id: get_tag_name
run: |
version=$(echo $GITHUB_REF | sed 's/refs\/tags\///')
echo "version=${version}" >> ${GITHUB_OUTPUT}
# BACKEND
- name: Build Docker Image
run: |
docker build -t seed-test-backend:${{ steps.get_tag_name.outputs.version }} ./backend
docker tag seed-test-backend:${{ steps.get_tag_name.outputs.version }} ${{ secrets.DOCKER_USERNAME }}/seed-test-backend:${{ steps.get_tag_name.outputs.version }}
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-backend:${{ steps.get_tag_name.outputs.version }}
# FRONTEND
- name: Build Docker Image
run: |
docker build -t seed-test-frontend:${{ steps.get_tag_name.outputs.version }} ./frontend
docker tag seed-test-frontend:${{ steps.get_tag_name.outputs.version }} ${{ secrets.DOCKER_USERNAME }}/seed-test-frontend:${{ steps.get_tag_name.outputs.version }}
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-frontend:${{ steps.get_tag_name.outputs.version }}
# SINGLE QUICK DEMO CONTAINER
- name: Build Docker Image as Latest
run: |
docker build -t seed-test-demo:${{ steps.get_tag_name.outputs.version }} .
docker tag seed-test-demo:${{ steps.get_tag_name.outputs.version }} ${{ secrets.DOCKER_USERNAME }}/seed-test-demo:${{ steps.get_tag_name.outputs.version }}
- name: Push Docker Image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/seed-test-demo:${{ steps.get_tag_name.outputs.version }}
- name: Post susccess message
uses: ./actions/notifyTeams
with:
title: "Publish Test-Release DockerHub 🧪🐳🌐"
text: "Publishing Images for test-release ${{ github.event.release.name }} successfully."
style: "success"
webhook: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}

- name: Post error message
if: ${{ failure() }}
uses: ./actions/notifyTeams
with:
title: "Publish Test-Release DockerHub 🐳🌐❌"
text: "Publishing Images for test-release ${{ github.event.release.name }} failed."
style: "failure"
webhook: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
3 changes: 1 addition & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ RUN yes | apt install ./google-chrome-stable_current_amd64.deb
RUN rm -f google-chrome-stable_current_amd64.deb

# install chromedriver
RUN google-chrome --version | grep -oP '\d+\.\d+\.\d+\.\d+' > chromeversion.txt
RUN apt-get install -yqq unzip curl
RUN wget -O /tmp/chromedriverzip.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$(cat chromeversion.txt)/linux64/chromedriver-linux64.zip
RUN wget -O /tmp/chromedriverzip.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$(curl https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE)/linux64/chromedriver-linux64.zip
RUN unzip /tmp/chromedriverzip.zip chromedriver-linux64/chromedriver -d /usr/local/bin/
RUN mv /usr/local/bin/chromedriver-linux64/chromedriver /usr/local/bin/chromedriver

Expand Down

0 comments on commit 2e2221b

Please sign in to comment.