Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mlpierce22 committed Feb 9, 2024
1 parent e3df4f7 commit c20e631
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build and Deploy Docker Image

permissions:
contents: read
packages: write

on:
push:
branches:
Expand All @@ -13,22 +17,25 @@ jobs:
uses: actions/checkout@v2

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

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

- name: Extract short SHA
id: sha
run: echo "::set-output name=short_sha::$(echo ${GITHUB_SHA} | cut -c 1-7)"

- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
tags: mlpierce22/tea:${GITHUB_SHA::7}
tags: mlpierce22/tea:${{ steps.sha.outputs.short_sha }}

- name: Output Docker image name
run: |
echo "Docker image name: mlpierce22/tea:${GITHUB_SHA::7}"
echo "Docker image name: mlpierce22/tea:${{ steps.sha.outputs.short_sha }}"

0 comments on commit c20e631

Please sign in to comment.