-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0604e0
commit 24ee50e
Showing
1 changed file
with
30 additions
and
0 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,30 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Create env file' | ||
run: echo "${{ secrets.TWITTER.ENV.DEVELOPMENT }}" >> .env.development | ||
- name: Build the Docker image | ||
run: | | ||
IMAGE_TAG=hmt1/twitter:$(date +%s) | ||
docker build . --file Dockerfile.dev --tag $IMAGE_TAG | ||
echo "::set-output name=image_tag::$IMAGE_TAG" | ||
- name: Print Image Tag | ||
run: echo ${{ steps.build.outputs.image_tag }} | ||
|
||
- name: Login to Docker Hub | ||
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Push Image to Docker Hub | ||
run: docker push ${{ steps.build.outputs.image_tag }} |