update ci
This commit is contained in:
parent
8ad5845efc
commit
cd669cd4d6
19
.github/workflows/pipeline.yml
vendored
19
.github/workflows/pipeline.yml
vendored
@ -17,19 +17,16 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Enable corepack
|
|
||||||
run: corepack enable
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --frozen-lockfile
|
run: npm install
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build
|
run: npm run build
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
@ -46,17 +43,17 @@ jobs:
|
|||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: liamp1/code
|
images: liamsgit.dev/LiamPietralla/code-snippets
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_TOKEN }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build and Push Docker Image to DockerHub
|
- name: Build and Push Docker Image to Registry
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
@ -94,3 +91,5 @@ jobs:
|
|||||||
ansible-playbook infra/ansible/deploy-playbook.yml --private-key private.key --inventory hosts.ini
|
ansible-playbook infra/ansible/deploy-playbook.yml --private-key private.key --inventory hosts.ini
|
||||||
env:
|
env:
|
||||||
APP_HOST: ${{ secrets.APP_HOST }}
|
APP_HOST: ${{ secrets.APP_HOST }}
|
||||||
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
@ -5,3 +5,7 @@
|
|||||||
become: yes # sudo
|
become: yes # sudo
|
||||||
roles:
|
roles:
|
||||||
- app
|
- app
|
||||||
|
vars:
|
||||||
|
registry_username: "{{ lookup('env', 'REGISTRY_USERNAME') }}"
|
||||||
|
registry_password: "{{ lookup('env', 'REGISTRY_PASSWORD') }}"
|
||||||
|
|
@ -1,7 +1,12 @@
|
|||||||
|
- name: Login to Docker Registry
|
||||||
|
docker_login:
|
||||||
|
username: "{{ registry_username }}"
|
||||||
|
password: "{{ registry_password }}"
|
||||||
|
|
||||||
- name: Run Code App Container
|
- name: Run Code App Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: code
|
name: code
|
||||||
image: liamp1/code:latest
|
image: liamsgit.dev/LiamPietralla/code-snippets
|
||||||
pull: yes
|
pull: yes
|
||||||
ports:
|
ports:
|
||||||
- "5000:80"
|
- "5000:80"
|
||||||
|
Loading…
Reference in New Issue
Block a user