-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BACK-662] Use GitHub Container Registry #3
Draft
Dakad
wants to merge
6
commits into
main
Choose a base branch
from
task/BACK-662_replace_docker_hub_by_github_packages_registry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
533b048
Update Dockerfile
thyagocl dcdb6e1
Add Makefile and VERSION file
Dakad 4c77706
Add github-action workflows to build&push Docker image and lint Docke…
Dakad 2d0d3c9
Merge branch 'main' into task/BACK-662_replace_docker_hub_by_github_p…
Dakad b2f1dd3
Update hadolint rule
Dakad cbbfe82
Add and push docker image's stable tag
Dakad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
tmp/* | ||
log/* | ||
db/*.sqlite3 | ||
.git | ||
.github | ||
|
||
.env | ||
.env.* | ||
|
||
/vendor/* | ||
/test/* | ||
|
||
*.DS_Store | ||
.vscode/ | ||
*.swp | ||
*~ | ||
*.md | ||
|
||
run | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
open-pull-requests-limit: 5 | ||
schedule: | ||
interval: "monthly" | ||
reviewers: | ||
- "apptweak/qawaii" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Hadolint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "Dockerfile" | ||
pull_request: | ||
types: [opened, synchronize] | ||
paths: | ||
- "Dockerfile" | ||
|
||
jobs: | ||
hadolint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile | ||
ignore: DL3018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build & Push Docker image | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- "README.md" | ||
branches: | ||
- "main" | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
USERNAME: apptweak | ||
VERSION: stable | ||
# Fullname of the repo in the style `owner/name` | ||
# REF: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | ||
PROJECT: ${{ github.repository }} | ||
|
||
jobs: | ||
build-stable: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout to branch | ||
uses: actions/checkout@v4 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.USERNAME }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push the container to GitHub Container Registry using tag | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.PROJECT }}:${{ env.VERSION }} | ||
push: true | ||
provenance: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
FROM alpine | ||
FROM alpine:3.20 | ||
LABEL org.opencontainers.image.source https://github.com/apptweak/simple-proxy-rotator | ||
RUN apk add --no-cache \ | ||
openssl \ | ||
curl \ | ||
bash \ | ||
git \ | ||
dumb-init \ | ||
openssl | ||
dumb-init | ||
|
||
# Make sure to use bash with pipefail in case something | ||
# fails while being piped to another command in the docker-build | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
WORKDIR /app | ||
ADD glider glider.conf entrypoint.sh ./ | ||
COPY glider glider.conf entrypoint.sh ./ | ||
|
||
EXPOSE 15000 | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
CMD ["/app/glider", "-config", "/app/glider.conf"] | ||
CMD ["/app/glider", "-config", "/app/glider.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
REGISTRY_HOST=ghcr.io | ||
USERNAME=apptweak | ||
PROJECT=simple-proxy-rotator | ||
VERSION := $(shell cat VERSION) | ||
IMAGE_NAME=$(REGISTRY_HOST)/$(USERNAME)/$(PROJECT) | ||
IMAGE=$(IMAGE_NAME):$(VERSION) | ||
|
||
build: | ||
docker build -f Dockerfile --platform "linux/x86_64" --tag "$(IMAGE)" --tag "$(IMAGE_NAME):stable" . | ||
# read --local --silent --prompt "Docker account's password: " passwd | ||
# echo "$passwd" | docker login --username apptweakci --password-stdin | ||
# gh auth token | docker login --username apptweakci --password-stdin ${IMAGE} | ||
docker push "$(IMAGE)" | ||
docker push "$(IMAGE_NAME):stable" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.0 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this GH action. We can use Concourse CI to build and publish to our GHCR