1001
This commit is contained in:
@@ -15,15 +15,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Kaniko config file
|
- name: Create Kaniko config file
|
||||||
run: |
|
run: |
|
||||||
echo '{"auths":{"${{ secrets.REGISTRY_URL }}":{"username":"${{ secrets.REGISTRY_USER }}","password":"${{ secrets.ACTIONS_PAT }}"}}}' > /kaniko/config.json
|
# Escribimos el config en el workspace, que sabemos que existe.
|
||||||
# Este comando crea el fichero de credenciales que Kaniko necesita.
|
echo '{"auths":{"${{ secrets.REGISTRY_URL }}":{"username":"${{ secrets.REGISTRY_USER }}","password":"${{ secrets.ACTIONS_PAT }}"}}}' > ${{ gitea.workspace }}/config.json
|
||||||
# Lo creamos en un directorio que montaremos en el siguiente paso.
|
|
||||||
|
|
||||||
- name: Build and Push Backend
|
- name: Build and Push Backend
|
||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ${{ gitea.workspace }}:/workspace \
|
-v ${{ gitea.workspace }}:/workspace \
|
||||||
-v /kaniko/config.json:/kaniko/.docker/config.json \
|
# Montamos el config desde el workspace a la ruta que Kaniko espera.
|
||||||
|
-v ${{ gitea.workspace }}/config.json:/kaniko/.docker/config.json \
|
||||||
gcr.io/kaniko-project/executor:v1.9.0 \
|
gcr.io/kaniko-project/executor:v1.9.0 \
|
||||||
--context=/workspace \
|
--context=/workspace \
|
||||||
--dockerfile=/workspace/Backend/GestionIntegral.Api/Dockerfile \
|
--dockerfile=/workspace/Backend/GestionIntegral.Api/Dockerfile \
|
||||||
@@ -35,7 +35,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v ${{ gitea.workspace }}:/workspace \
|
-v ${{ gitea.workspace }}:/workspace \
|
||||||
-v /kaniko/config.json:/kaniko/.docker/config.json \
|
# Hacemos lo mismo para el frontend.
|
||||||
|
-v ${{ gitea.workspace }}/config.json:/kaniko/.docker/config.json \
|
||||||
gcr.io/kaniko-project/executor:v1.9.0 \
|
gcr.io/kaniko-project/executor:v1.9.0 \
|
||||||
--context=/workspace \
|
--context=/workspace \
|
||||||
--dockerfile=/workspace/Frontend/Dockerfile \
|
--dockerfile=/workspace/Frontend/Dockerfile \
|
||||||
@@ -50,9 +51,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Deploy to Production
|
- name: Deploy to Production
|
||||||
run: |
|
run: |
|
||||||
# Este paso no necesita cambios, pero para mantenerlo simple,
|
|
||||||
# lo ejecutaremos directamente sin la acción de checkout,
|
|
||||||
# ya que no necesita los ficheros del repositorio.
|
|
||||||
apk add --no-cache openssh-client
|
apk add --no-cache openssh-client
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
|
echo "${{ secrets.PROD_SERVER_SSH_KEY }}" > ~/.ssh/id_rsa
|
||||||
|
|||||||
Reference in New Issue
Block a user