Skip to content

Commit

Permalink
Swtich build pipeline from Circle CI to Github Action (#70)
Browse files Browse the repository at this point in the history
* switch to github action pipeline
---------

Co-authored-by: Bill Wang <bill.wang@bill.wang>
  • Loading branch information
ozbillwang and Bill Wang authored Oct 3, 2024
1 parent 1cac1e6 commit c8e550b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 111 deletions.
92 changes: 0 additions & 92 deletions .circleci/config.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- "main"
- "master"
schedule:
- cron: '0 4 * * 0'
pull_request:
branches: ["**"]

Expand Down Expand Up @@ -62,3 +64,26 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

# - name: Checkout code
# uses: actions/checkout@v2

# - name: check the platform in multi-arch images
# run: |
# echo ${{ steps.meta.outputs.tags }}
# bash ./test.sh ${{ steps.meta.outputs.tags }}

- name: set tags
run: |
# install crane
curl -LO https://github.com/google/go-containerregistry/releases/download/v0.20.2/go-containerregistry_Linux_x86_64.tar.gz
tar zxvf go-containerregistry_Linux_x86_64.tar.gz
chmod +x crane
export VERSION=($(docker run -i --rm ${{ steps.meta.outputs.tags }} version|awk '{print $NF}'))
echo $VERSION
./crane auth login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }} index.docker.io
./crane copy ${{ steps.meta.outputs.tags }} ${{ env.IMAGE_NAME }}:latest
./crane copy ${{ steps.meta.outputs.tags }} ${{ env.IMAGE_NAME }}:${VERSION}
./crane copy ${{ steps.meta.outputs.tags }} ${{ env.IMAGE_NAME }}:v${VERSION}
rm -f /home/runner/.docker/config.json
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ A useful simple git container running in alpine Linux, especially for tiny Linux

[![DockerHub Badge](http://dockeri.co/image/alpine/git)](https://hub.docker.com/r/alpine/git/)

### Additional notes about multi-arch images
### notes about new github action pipeline

From 3rd Oct 2024, the automation build and deploy pipeline has been switched from Circle CI to Github Action.

### notes about multi-arch images

This feature was added on 23th May 2021.

Expand All @@ -22,27 +26,12 @@ https://github.com/alpine-docker/git

### CI build logs

https://app.circleci.com/pipelines/github/alpine-docker/git
https://github.com/alpine-docker/git/actions

### Docker image tags

https://hub.docker.com/r/alpine/git/tags/

Notes:

New tags with non-root user in image has been created.

```
alpine/git:<version>-user
alpine/git:user
```
Its uid and gid in container are 1000
```
$ docker run -ti --rm --entrypoint=id alpine/git:user
uid=1000(git-user) gid=1000(git-user)
```
Docker build from feature branch `feature/non-root`

### Usage

docker run -ti --rm -v ${HOME}:/root -v $(pwd):/git alpine/git <git_command>
Expand Down Expand Up @@ -112,8 +101,9 @@ Refer:

### Automation builds

Set CI to run builds every month.
- build latest alpine image locally
Set CI to run builds per week

- build latest alpine image with multi-arch supported
- Get the git version from the image
- use the git's version as image tag as well (`v${GIT_VERSION}`)
- update `latest` tag for this image

0 comments on commit c8e550b

Please sign in to comment.