Before Thursday noon

Does your website wait for someone to publish it by hand? This lesson teaches how a repository checks and publishes each change itself, and how to name one version.

  • Lesson 8 of 10
  • 8 min

The scene

On the last Thursday of the month, a man from a distant town stood in the court lobby, a bus ticket folded in his hand, reading the notice board where printed hearing schedules hang. He was a witness, come to tell the judge what he had seen. His hearing, his turn in one of the halls where judges sit, was on Sunday, the first of the new month.

He stopped Ibrahim, the head clerk. "Which hall am I in? My letter doesn't say, and the board only shows this month."

"Next month's schedule reaches us today," Ibrahim said. "It goes on the court's web page, and our print shop prints it for this board and the hall doors. The shop takes the file at twelve, then closes until Sunday."

His bus left on Sunday at 6:00 a.m. "The bus gets in at a quarter past eight. I'll have no time to ask." He sat on a bench to wait.

At nine the schedule came on paper from Judge Sumaya's office. Ibrahim took it to Najla with one sum in his head: Hussam, in the IT office, published the website by hand, file by file, after his own work, rarely before evening, and the print shop needed it by noon.

Ibrahim rang Hussam, who said, "Put it in a pull request as usual. I'll come up."

Najla typed fast on a new and opened a . At 11:20 a red mark appeared beside it.

Hussam clicked it. "A check," he said. "I wrote its steps last week in a file in the , and , a GitHub service, runs them on every change." He read: "Sunday, 9:00: hall 8 does not exist. Halls run from 1 to 7."

"That's the man in the lobby," said Ibrahim.

Najla checked the paper. The judge's office had written a hasty 6, and she had read an 8. Published, it would have sent the man searching the corridors for a hall that did not exist.

She fixed it and the mark turned green. Ibrahim read and approved the change, and it was . At 11:40 the court's page changed. Nobody had touched the website.

"That's ," Hussam said. "It publishes the site from the repository's files, so I'm done copying. Together, that check and this publishing are called ."

That left the print shop. Najla's announcements would change the page again that afternoon, so at twelve Hussam put a on that moment, a fixed name, "new-month-schedule", that later would not move. On it he built a , a page with a title, a short note and the schedule file, and sent its link to the print shop, which printed exactly that version.

Ibrahim went down and showed the man the page on his phone. Hall 6.

On Sunday the man's bus arrived at a quarter past eight. At 8:30 he stood at hall 6, ticket still in hand. On the door hung the print shop's sheet: his hearing, 9:00.

The idea

A repository can check each change, publish it, and fix a name on one state.

  • : a fixed name on one saved state; later commits do not move it.
  • : a page built on a tag, with notes and files for whoever needs that exact state.
  • : checks that run by themselves on every change, then publish what passed, with no hand copying.
  • : the GitHub service that runs those steps from a file in the repository.
  • : publishes a website from the repository's own files, as this site is published.

If someone asks for the approved version, send a release link; the website changes with every merge.

From a named moment to the site Three boxes in a row, arrows pointing to the right. The first is a named state, one saved moment. The second is checks that run by themselves. The third is drawn stronger: the site is published. A note underneath says there is no copying by hand. The site you are reading is published along this path. From a named moment to the site A named state One moment Checks run By themselves The site Is published No copying by hand

Try it yourself

  1. In a well-known public repository, open a . You will see the it was built on and its files.
  2. Click the green or red mark beside a merged there to see what was checked.
  3. Find the runs started; each names the change behind it.
  4. Find in your own repository's settings; it asks which branch to publish from.

A repository with no written check shows no marks. On a free account, GitHub Pages works only with public repositories.

Where this fits

The repository now publishes the court's page itself. The next lesson asks who can see and write in your repository.

Check yourself

Your team edits a procedures manual daily in a repository that publishes it online. The print shop wants today's version. Editing continues this afternoon, and in a month someone will ask what was printed. What do you give them?

Use the arrow keys to read the options, then press Space to answer.

Sources

Type a lesson, an idea or a job. English words work in Arabic too.