Skip to content

fix action to push image to docker hub #2

fix action to push image to docker hub

fix action to push image to docker hub #2

name: build + push to docker hub
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Step 3: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Step 4: Build the Docker image
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKER_USERNAME }}/altserver-docker:latest .
# Step 5: Push the Docker image to Docker Hub
- name: Push Docker image
run: docker push ${{ secrets.DOCKER_USERNAME }}/altserver-docker:latest