-
Notifications
You must be signed in to change notification settings - Fork 482
66 lines (64 loc) · 2.33 KB
/
skaffold_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Skaffold
on: [push]
jobs:
quicktest:
build:
name: Skaffold Build
runs-on: ubuntu-22.04
container:
image: gcr.io/k8s-skaffold/skaffold:v2.6.3-lts
# env:
# NODE_ENV: development
# ports:
# - 80
# volumes:
# - my_docker_volume:/volume_mount
# options: --cpus 1
steps:
- run: |
echo hi
echo "DIRECT K8S_DOCKERHUB_REPOSITORY=$K8S_DOCKERHUB_REPOSITORY"
echo "K8S_DOCKEHUB_REPOSITORY=${{ env.K8S_DOCKEHUB_REPOSITORY }}"
echo "SKAFFOLD_DEFAULT_REPO=$SKAFFOLD_DEFAULT_REPO"
echo "GITHUB_WORKFLOW=${GITHUB_WORKFLOW}"
env:
SKAFFOLD_DEFAULT_REPO: ${{ env.K8S_DOCKEHUB_REPOSITORY }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ${{ secrets.K8S_DOCKEHUB_REPOSITORY }}
username: ${{ secrets.K8S_DOCKERHUB_USERNAME }}
password: ${{ secrets.K8S_DOCKERHUB_TOKEN }}
- name: Checkout sources
uses: actions/checkout@v3
- name: Skaffold Cache
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/.skaffold/cache"
key: skaffold-${{ hashFiles('**/cache') }}
restore-keys: |
skaffold-
- run: |
skaffold build \
--push \
&& true
env:
SKAFFOLD_DEFAULT_REPO: ${{ secrets.K8S_DOCKEHUB_REPOSITORY }}
# name: GitHub Actions Demo
# run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
# on: [push]
# jobs:
# Explore-GitHub-Actions:
# runs-on: ubuntu-latest
# steps:
# - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
# - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
# - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# - name: Check out repository code
# uses: actions/checkout@v3
# - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
# - run: echo "🖥️ The workflow is now ready to test your code on the runner."
# - name: List files in the repository
# run: |
# ls ${{ github.workspace }}
# - run: echo "🍏 This job's status is ${{ job.status }}."