Replaced env with vars
This commit is contained in:
parent
8bd64f03c8
commit
abbb4a26ac
@ -28,7 +28,7 @@ jobs:
|
|||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ vars.REGISTRY }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
# This step uses the docker/build-push-action action to build the image, based on your repository's Dockerfile. If the build succeeds, it pushes the image to GitHub Packages.
|
# This step uses the docker/build-push-action action to build the image, based on your repository's Dockerfile. If the build succeeds, it pushes the image to GitHub Packages.
|
||||||
# It uses the context parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the docker/build-push-action repository.
|
# It uses the context parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the docker/build-push-action repository.
|
||||||
@ -62,14 +62,14 @@ jobs:
|
|||||||
ssh-private-key: ${{ secrets.SSH_PRIV_KEY }}
|
ssh-private-key: ${{ secrets.SSH_PRIV_KEY }}
|
||||||
|
|
||||||
- name: Login to registry
|
- name: Login to registry
|
||||||
run: ssh ${{ env.TARGET_USER }}@${{ env.TARGET }} "docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ env.REGISTRY }}"
|
run: ssh ${{ vars.TARGET_USER }}@${{ vars.TARGET }} "docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} ${{ vars.REGISTRY }}"
|
||||||
- name: Pull new image
|
- name: Pull new image
|
||||||
run: ssh ${{ env.TARGET_USER }}@{{ env.TARGET }} "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
|
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker pull ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
|
||||||
- name: Logout from registry
|
- name: Logout from registry
|
||||||
run: ssh ${{ env.TARGET_USER }}@{{ env.TARGET }} "docker logout ${{ env.REGISTRY }}"
|
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker logout ${{ vars.REGISTRY }}"
|
||||||
- name: Stop and Remove the container
|
- name: Stop and Remove the container
|
||||||
run: ssh ${{ env.TARGET_USER }}@{{ env.TARGET }} "docker stop ${{ env.IMAGE_NAME }} && docker remove ${{ env.IMAGE_NAME }}"
|
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker stop ${{ env.IMAGE_NAME }} && docker remove ${{ env.IMAGE_NAME }}"
|
||||||
- name: Recreate the container
|
- name: Recreate the container
|
||||||
run: ssh ${{ env.TARGET_USER }}@{{ env.TARGET }} "docker run --name=${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:latest"
|
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker run --name=${{ env.IMAGE_NAME }} ${{ env.IMAGE_NAME }}:latest"
|
||||||
- name: Clean old images
|
- name: Clean old images
|
||||||
run: ssh ${{ env.TARGET_USER }}@{{ env.TARGET }} "docker image prune -a"
|
run: ssh ${{ vars.TARGET_USER }}@{{ vars.TARGET }} "docker image prune -a"
|
||||||
|
Loading…
Reference in New Issue
Block a user