Skip to content

Commit

Permalink
Add Docker workflow for publishing Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
fvergaracl committed Feb 7, 2024
1 parent 2867ddb commit 33cb66f
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Docker Image

on:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
pull_request:
branches:
- main

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

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

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker Image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: |
fvergaracl/game:latest
fvergaracl/game:${{ github.ref_name }}
fvergaracl/game:${{ github.ref_name }}-${{ github.run_number }}

0 comments on commit 33cb66f

Please sign in to comment.