Skip to content

Commit

Permalink
Migrating for Github packages to Docker Hub for container registry (#5)
Browse files Browse the repository at this point in the history
* Using docker hub and latest build-push-action version

* Pushing to latest tag too

* Multiple target platforms

* Nevermind, can't support arm

* Updated readme
  • Loading branch information
qmac authored Apr 7, 2021
1 parent 1d3975d commit 37e22e1
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
47 changes: 38 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,46 @@ jobs:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
-
name: Check out the repo
uses: actions/checkout@v2

- name: Checkout submodules
-
name: Prepare tags
id: prep
run: |
DOCKER_IMAGE=revdotcom/fstalign
VERSION=develop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=created::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
-
name: Checkout submodules
uses: textbook/git-checkout-submodule-action@2.1.1

- name: Push to GitHub Packages
uses: docker/build-push-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Build and push
uses: docker/build-push-action@v2
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: revdotcom/fstalign/fstalign
tag_with_ref: true
context: .
platforms: linux/amd64
push: true
tags: |
revdotcom/fstalign:latest
${{ steps.prep.outputs.tags }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ make test

### Docker

The fstalign docker image is hosted on Github packages and can be pulled through:
The fstalign docker image is hosted on Docker Hub and can be easily pulled:
```
docker pull docker.pkg.github.com/revdotcom/fstalign/fstalign:1.0.0
docker pull revdotcom/fstalign
```

This docker image contains the source code, built dependencies, and the built binary. A container can be started using:
See https://hub.docker.com/r/revdotcom/fstalign/tags for the available versions/tags to pull. This docker image contains the source code, built dependencies, and the built binary. A container can be started using:
```
docker run --rm -it docker.pkg.github.com/revdotcom/fstalign/fstalign:1.0.0
docker run --rm -it revdotcom/fstalign:1.0.0
```

Additionally, if you desire to run the tool on local files you can mount local directories with the `-v` flag of the `docker run` command. Once the container is running, the binary is located at `/fstalign/build/fstalign`.
Expand Down

0 comments on commit 37e22e1

Please sign in to comment.