Publish to my own repo #1
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
name: Docker Image CI | |
on: | |
push: | |
branches: [ "publish_changes" ] | |
pull_request: | |
branches: [ "publish_changes" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Set up Docker tags | |
id: tags | |
run: | | |
TIMESTAMP=$(date +%s) | |
echo "::set-output name=timestamp::$TIMESTAMP" | |
echo "::set-output name=latest::latest" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
ahmadmujahid/secure-ai-tools:${{ steps.tags.outputs.timestamp }} | |
ahmadmujahid/secure-ai-tools:${{ steps.tags.outputs.latest }} | |
- name: Logout from Docker Hub | |
run: docker logout |