-
Notifications
You must be signed in to change notification settings - Fork 0
Convert to actions #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,5 +1,4 @@ | ||
| .github/ | ||
| .idea/ | ||
| *.aes | ||
| codeship-services.yml | ||
| codeship-steps.yml | ||
| dockercfg |
This file contains hidden or 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,38 @@ | ||
| name: Build and Publish | ||
|
|
||
| on: | ||
| push: | ||
| schedule: | ||
| # High load times include the start of every hour. | ||
| # If the load is sufficiently high enough, some queued jobs may be dropped. | ||
| # To decrease the chance of delay, schedule your workflow to run at a different time of the hour. | ||
| # cron: Minutes Hours Day-of-month Month Day-of-week | ||
| - cron: "7 1 8 * *" | ||
|
|
||
| jobs: | ||
| build-and-publish: | ||
| name: Build and Publish | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
| - name: Extract metadata (tags, labels) for Docker | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ vars.DOCKER_ORG }}/php8 | ||
| tags: | | ||
| type=ref,event=branch | ||
| # set latest tag for default branch | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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.
I'm suspicious about using
is_default_branch. We may change the default branch at some point, not realizing it would affect the image tag. Or maybe I'm not understanding the situation.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.
I can comment that better in the README. Scheduled builds only build the default branch, So we will want to update the default branch to whatever the latest version is. Alternatively, we could always update
mainwhenever we update the latest branch or make a new branch. Which theoretically we should have already been doing, but haven'tThere 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.
@jason-jackson Check my understanding here. It looks like this will run at 1:07 am on the 8th day of each month, and I think you said scheduled GitHub Actions only run on the default branch of the repo. It will build the docker image and then tag it (1) as
latestif it's the default branch (won't it always be?) and (2) tag it with the branch name (e.g.8.1).Is that correct?
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.
That is correct. Currently scheduled build was for 1am on the 8th day of the month, but due to warning, I pushed it out a few minutes.
It might not always be pushed to the default branch. It will create a tag for every push to any branch with the branch name as the tag (with certain characters changed if needed). The
onhas bothpushandscheduleso it will do it for both of them. See https://hub.docker.com/r/silintl/php8.