Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup (Join) #2 - Tasks: A-5 #34

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JOIN_IMAGE_TAG=2024-08-21--29-53
50 changes: 7 additions & 43 deletions .github/workflows/image_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,11 @@ on:
push:
branches: [ main ]

env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}

jobs:

build:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2
- name: docker login
run: | # log into docker hub account
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD

- name: Get current date # get the date of the build
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d--%M-%S')"

- name: Run a one-line script
run: echo running in repo ${GITHUB_REPOSITORY#*/} branch ${GITHUB_REF##*/} on ${{ steps.date.outputs.date }}

- name: build docker image
run: |
docker build -t $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }} ./frontend
docker images

- name: push docker image
run: |
docker push $DOCKER_USER/${GITHUB_REPOSITORY#*/}:${GITHUB_REF##*/}_${{ steps.date.outputs.date }}

- name: Create artifact text file
run: |
echo ${{ steps.date.outputs.date }} > join_page_tag_file.txt
echo "Created tag text file"

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: join-page-image-tag
path: join_page_tag_file.txt
overwrite: true
build:
if: ${{ !contains(github.event.head_commit.author.name, 'Github Actions bot to update .env with latest tags') }}
uses: e-mission/e-mission-server/.github/workflows/reusable_image_build_push.yml@master
with:
repo: ${{ github.event.repository.name }}
branch: ${{ github.ref_name }}
secrets: inherit