mirror of
https://github.com/r-freeman/portfolio.git
synced 2024-11-21 19:55:41 +00:00
This commit is contained in:
parent
4a1b7fa6ef
commit
4ead0f781f
@ -19,26 +19,26 @@ jobs:
|
||||
env:
|
||||
SECRET_PASSPHRASE: ${{ secrets.SECRET_PASSPHRASE }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
- name: Login to registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{secrets.DOCKER_HUB_USERNAME}}
|
||||
password: ${{secrets.DOCKER_HUB_PASSWORD}}
|
||||
registry: git.ryansnet.xyz
|
||||
username: ${{secrets.REGISTRY_USERNAME}}
|
||||
password: ${{secrets.REGISTRY_PASSWORD}}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
with:
|
||||
config-inline: |
|
||||
[registry."docker.io"]
|
||||
mirrors = ["mirror.gcr.io"]
|
||||
[registry."${{secrets.REGISTRY_URL}}"]
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: https://github.com/docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
|
||||
- name: Build and tag image
|
||||
run: |
|
||||
docker build -t ${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{secrets.REPO_NAME}}:latest .
|
||||
# docker tag ${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{secrets.REPO_NAME}}:latest ${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{secrets.REPO_NAME}}:latest
|
||||
|
||||
- name: Push image
|
||||
run: docker push ${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{secrets.REPO_NAME}}:latest
|
||||
|
||||
- name: Stop and remove old Docker container
|
||||
continue-on-error: true
|
||||
@ -48,9 +48,9 @@ jobs:
|
||||
|
||||
- name: Pull new image and start Docker container
|
||||
run: |
|
||||
sudo docker pull ${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
|
||||
sudo docker pull ${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{vars.REPO_NAME}}:latest
|
||||
sudo docker run -d --restart unless-stopped \
|
||||
--env-file ./.env \
|
||||
--name portfolio \
|
||||
-p ${{vars.DEPLOY_IP}}:3000:3000 \
|
||||
${{secrets.DOCKER_HUB_USERNAME}}/${{vars.REPO_NAME}}:v1
|
||||
${{secrets.REGISTRY_URL}}/${{secrets.REGISTRY_USERNAME}}/${{vars.REPO_NAME}}:latest
|
Loading…
Reference in New Issue
Block a user