Skip to content
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

Workflow #47

Merged
merged 45 commits into from
May 28, 2021
Merged

Workflow #47

merged 45 commits into from
May 28, 2021

Conversation

kurtbruns
Copy link
Collaborator

@kurtbruns kurtbruns commented May 25, 2021

This isn't ready to merge, but I'm opening up this pull request to start testing Vercel.

  • Github Pages environment is currently broken because the baseURL is no longer set to https://3b1b.github.io/3Blue1Brown.com/ in config.

@vercel
Copy link

vercel bot commented May 25, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/3b1b/3blue1brown-website/5PbFftCocPd1PjvaSNqkG8ALKEBn
✅ Preview: https://3blue1brown-website-git-workflow-3b1b.vercel.app

@kurtbruns
Copy link
Collaborator Author

kurtbruns commented May 25, 2021

The current branch variable needs to be made available for creating Git LFS URLs in the staging environment. @3b1b Assuming Vercel works like the environment that runs the github action, try updating Vercel's build command to something like this:

env HUGO_PARAMS_BRANCH=`git rev-parse --abbrev-ref HEAD` hugo --environment staging

There may be another way to get the current branch name in Vercel, but as long as git is available on the command line, this should work fine. Keep any other flags we currently pass to the build command. Once this is done, the current branch can be accessed like this for generating URLs in the staging environment.

.Site.Branch

Edit: If the above doesn't work, this preview variable might do the trick.

Screen Shot 2021-05-25 at 4 29 08 PM

@kurtbruns kurtbruns linked an issue May 25, 2021 that may be closed by this pull request
@kurtbruns
Copy link
Collaborator Author

The figure-test shortcode demonstrates environment aware URLs. See the content/lessons/2021/git-lfs-test/ for an example.

http://localhost:1313/lessons/git-lfs-test/

@vincerubinetti
Copy link
Collaborator

vincerubinetti commented May 26, 2021

Do you want to delete the test figure component, and put the real one into effect in this PR. I believe a clean way to do it would be to make layouts/partials/asset-url.html:

{{- $path := . -}}
{{- if $resource := .Page.Resources.GetMatch $path -}}
  {{- if (eq site.Params.environment "production") -}}
    {{- printf "%s%s" site.Params.Bucket $resource.RelPermalink ) -}} 
  {{- else if (eq site.Params.environment "staging") -}}
    {{- printf "https://github.com/3b1b/3Blue1Brown.com/raw/%s/content/%s/%s" site.Params.branch .Page.File.Dir $path -}}
  {{- else -}}
    {{- resource.RelPermalink -}}
  {{- end -}}
{{- else -}}
  {{- errorf (printf "%s: Unable to find resource given the path:\"%s\"" .Position $path) -}}
{{- end -}}

Then in layouts/shortcodes/figure.html, change partial rel-url mentions to partial asset-url

@kurtbruns kurtbruns linked an issue May 27, 2021 that may be closed by this pull request
@netlify
Copy link

netlify bot commented May 27, 2021

✔️ Deploy Preview for 3blue1brown ready!

🔨 Explore the source changes: 72d1727

🔍 Inspect the deploy log: https://app.netlify.com/sites/3blue1brown/deploys/60b0269f597dbc57799fdcd5

😎 Browse the preview: https://deploy-preview-47--3blue1brown.netlify.app

@3b1b 3b1b merged commit 4797018 into main May 28, 2021
@3b1b 3b1b deleted the workflow branch May 28, 2021 17:03
3b1b added a commit that referenced this pull request May 28, 2021
* Setup git lfs file types and created test post.

* Fixed/updated git LFS URLs

* Testing modified file and fixing path

* Changed order of git lfs url for example

* Created test sync action

* Fixed bad find replace to correct variable names

* Added step and flag to download git lfs objects

* Set acl to public, testing workflow

* Updated bad flag, testing workflow

* Testing sync workflow

* Fix typo, testing sync workflow

* Added test figure and updated URL paths for example post

* Test delete file and new Ubuntu version

* Added flag to delete unused files. Testing workflow action.

* Updated example

* Adds mug animation

* Changed old workflow to be consistent

* Testing workflow, dry run

* Changed bucket variable name

* Changed include patterns to lessons directory. Testing workflow, dry run

* Modified test date page date to not be a future date. Testing workflow.

* updated gitattributes

* updated gitattributes, testing workflow

* Testing workflow: delete asset

* Testing workflow: delete asset

* Added production config site parameters, testing branch environment variable

* Added parameter to test workflow

* Testing workflow with example shortcode

* Fixed gitattributes paths

* Testing workflow, updated staging paths

* Test of git-lfs

* Deleted file that should have been tracked with git LFS

* Fixed bad path.

* Changed action to sync bucket on push to main and to prep for vercel deploy

* Added text and image to essence of calculus

* Added netlify config file

* Changed boolean to string

* Pushing arbitrary change to test netlify

* Testing netlify preview

* Testing netlify preview

* Added netlify file config to test CLI

* Modified figure shortcode to be aware of page bundle resources.

* Test push, added snippets, calculus lesson 1 assets

Co-authored-by: Grant Sanderson <grant@3blue1brown.com>
Co-authored-by: Josh Pullen <hello@joshuapullen.com>
Former-commit-id: 730507cf933e81a52313b7067a47b1f84b5fc339 [formerly 4797018]
Former-commit-id: c24f93bc0c866f6e0f99b5ff05bcf5c7710a3766
3b1b added a commit that referenced this pull request May 28, 2021
* Setup git lfs file types and created test post.

* Fixed/updated git LFS URLs

* Testing modified file and fixing path

* Changed order of git lfs url for example

* Created test sync action

* Fixed bad find replace to correct variable names

* Added step and flag to download git lfs objects

* Set acl to public, testing workflow

* Updated bad flag, testing workflow

* Testing sync workflow

* Fix typo, testing sync workflow

* Added test figure and updated URL paths for example post

* Test delete file and new Ubuntu version

* Added flag to delete unused files. Testing workflow action.

* Updated example

* Adds mug animation

* Changed old workflow to be consistent

* Testing workflow, dry run

* Changed bucket variable name

* Changed include patterns to lessons directory. Testing workflow, dry run

* Modified test date page date to not be a future date. Testing workflow.

* updated gitattributes

* updated gitattributes, testing workflow

* Testing workflow: delete asset

* Testing workflow: delete asset

* Added production config site parameters, testing branch environment variable

* Added parameter to test workflow

* Testing workflow with example shortcode

* Fixed gitattributes paths

* Testing workflow, updated staging paths

* Test of git-lfs

* Deleted file that should have been tracked with git LFS

* Fixed bad path.

* Changed action to sync bucket on push to main and to prep for vercel deploy

* Added text and image to essence of calculus

* Added netlify config file

* Changed boolean to string

* Pushing arbitrary change to test netlify

* Testing netlify preview

* Testing netlify preview

* Added netlify file config to test CLI

* Modified figure shortcode to be aware of page bundle resources.

* Test push, added snippets, calculus lesson 1 assets

Co-authored-by: Grant Sanderson <grant@3blue1brown.com>
Co-authored-by: Josh Pullen <hello@joshuapullen.com>
Former-commit-id: 730507cf933e81a52313b7067a47b1f84b5fc339 [formerly 4797018]
Former-commit-id: c24f93bc0c866f6e0f99b5ff05bcf5c7710a3766
Former-commit-id: 46ad579
Former-commit-id: 717c7abd32f0d27591db05947fbe4db657afcfbf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Workflow Development Linode Object Storage Setup
4 participants