Fix workflow
This commit is contained in:
@@ -9,6 +9,17 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
login:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Login to Registry (scoped)
|
||||||
|
uses: docker/login-action@v4
|
||||||
|
with:
|
||||||
|
username: ${{ vars.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
scope: 'hacecalor/fichajes@push'
|
||||||
|
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -18,14 +29,14 @@ jobs:
|
|||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t my-app .
|
run: docker build -t my-app .
|
||||||
|
|
||||||
- name: Log in to Docker registry
|
|
||||||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
|
||||||
|
|
||||||
- name: Tag Docker image
|
- name: Tag Docker image
|
||||||
run: docker tag my-app my-registry/my-app:${{ github.run_number }}
|
run: docker tag my-app my-registry/my-app:${{ github.run_number }}
|
||||||
|
|
||||||
- name: Push Docker image to registry
|
- name: Push Docker image to registry
|
||||||
run: docker push my-registry/my-app:${{ github.run_number }}
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: hacecalor/fichajes:${{ github.run_number }}
|
||||||
|
|
||||||
- name: Connect to remote host
|
- name: Connect to remote host
|
||||||
uses: appleboy/ssh-action@v1
|
uses: appleboy/ssh-action@v1
|
||||||
|
|||||||
Reference in New Issue
Block a user