Merge pull request 'feature-test' (#1) from feature-test into master
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 11s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 11s
Reviewed-on: https://git.chopark.home/wesscho/catalog26/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
26
.gitea/workflows/demo.yaml
Normal file
26
.gitea/workflows/demo.yaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: Gitea Actions Demo
|
||||||
|
run-name: ${{ github.actor }} is building and pushing 🚀
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Explore-Gitea-Actions:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
# We use single quotes around the secret to prevent shell interpretation
|
||||||
|
# and the VM IP to bypass the 'server' DNS issue.
|
||||||
|
run: |
|
||||||
|
echo '${{ secrets.GITEA_TOKEN }}' | docker login git.chopark.home:3000 --username ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
|
- name: Build and Push Docker Image
|
||||||
|
run: |
|
||||||
|
docker build -t git.chopark.home:3000/${{ github.repository }}:latest .
|
||||||
|
docker push git.chopark.home:3000/${{ github.repository }}:latest
|
||||||
|
|
||||||
|
- name: List files in the repository
|
||||||
|
run: ls ${{ github.workspace }}
|
||||||
|
|
||||||
|
- run: echo "🍏 Build and Push status is ${{ job.status }}."
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: Build and Deploy
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Login to Registry
|
|
||||||
# run: echo "${{ secrets.GITEA_TOKEN }}" | docker login 192.168.x.x --username ${{ github.actor }} --password-stdin
|
|
||||||
run: echo "${{ secrets.GITEA_TOKEN }}" | docker login git.chopark.home --username ${{ github.actor }} --password-stdin
|
|
||||||
|
|
||||||
- name: Build and Push
|
|
||||||
run: |
|
|
||||||
# docker build -t 192.168.x.x/${{ github.repository }}:latest .
|
|
||||||
# docker push 192.168.x.x/${{ github.repository }}:latest
|
|
||||||
docker build -t git.chopark.home/${{ github.repository }}:latest .
|
|
||||||
docker push git.chopark.home/${{ github.repository }}:latest
|
|
||||||
|
|
||||||
deploy-to-k8s:
|
|
||||||
needs: build-and-push
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set Kubeconfig
|
|
||||||
run: echo "${{ secrets.KUBE_CONFIG }}" > kubeconfig.yaml
|
|
||||||
|
|
||||||
- name: Update Deployment
|
|
||||||
run: |
|
|
||||||
export KUBECONFIG=kubeconfig.yaml
|
|
||||||
# kubectl set image deployment/my-app my-app=192.168.x.x/${{ github.repository }}:latest
|
|
||||||
kubectl set image deployment/catalog26-deployment catalog26-deployment=git.chopark.home/${{ github.repository }}:latest
|
|
||||||
Reference in New Issue
Block a user