Add github actions (for build and push the docker image)
This commit is contained in:
parent
74304f975f
commit
355fb8e915
32
.github/workflows/build-and-push.yaml
vendored
Normal file
32
.github/workflows/build-and-push.yaml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: Build and Publish Docker Image
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
env:
|
||||
IMAGE_NAME: rbehzadan/wireguard-3proxy
|
||||
IMAGE_TAG: ${{ github.event.release.tag_name }}
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} .
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
||||
|
||||
- name: Push Docker image to Docker Hub
|
||||
run: |
|
||||
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
|
||||
docker tag ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} ${{ env.IMAGE_NAME }}:latest
|
||||
docker push ${{ env.IMAGE_NAME }}:latest
|
Loading…
Reference in New Issue
Block a user