Skip to content

Commit

Permalink
- Docker: Auto-build for Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareRat committed Sep 8, 2024
1 parent 754a8f2 commit 5606f9b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Push Docker Image

on:
push:
branches:
- main
paths:
- 'Dockerfile'
- '**/Dockerfile'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
run: |
docker build --tag ${{ secrets.DOCKER_HUB_USERNAME }}/pppwn_live:latest .
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Push Docker image
run: |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/pppwn_live:latest

0 comments on commit 5606f9b

Please sign in to comment.