Skip to content

Commit

Permalink
use versions. try to delete .git to save space
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Jan 7, 2024
1 parent 810230b commit 32fba3e
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Hello Folks
on: [workflow_dispatch]
name: CICD
on: push
jobs:
greeting:
runs-on: ubuntu-latest
Expand All @@ -13,13 +13,13 @@ jobs:

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -29,15 +29,27 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Check working space directory1
run: du ${GITHUB_WORKSPACE} -h -d 1

- name: Get more space
run: |
df . -h
sudo rm -rf ${GITHUB_WORKSPACE}/.git
df . -h
- name: Check working space directory2
run: du ${GITHUB_WORKSPACE} -h -d 1

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
Expand Down

0 comments on commit 32fba3e

Please sign in to comment.