auto deploy to docker hub
This commit is contained in:
parent
1d6fca2d53
commit
97faf452c6
4 changed files with 43 additions and 5 deletions
37
.github/workflows/docker-hub.yml
vendored
Normal file
37
.github/workflows/docker-hub.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Docker Hub Image Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["master"]
|
||||
|
||||
jobs:
|
||||
docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- name: Check out the repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Extract SERVER_VERSION from launch.sh
|
||||
id: extract-version
|
||||
run: |
|
||||
SERVER_VERSION=$(grep 'SERVER_VERSION=' launch.sh | cut -d '=' -f2)
|
||||
echo "SERVER_VERSION=$SERVER_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push the Docker image
|
||||
uses: docker/build-push-action@v5.3.0
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:latest
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/allthemods10:${{ env.SERVER_VERSION }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue